diff options
| author | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2013-12-30 11:33:16 -0200 |
|---|---|---|
| committer | Paulo Zanoni <paulo.r.zanoni@intel.com> | 2014-01-07 09:57:04 -0200 |
| commit | 69856b5e7b96f6945da7f6c42a1468a38513b3ca (patch) | |
| tree | f1ca29f49d4c83bdaa418ee71b13b4ef2d2416c1 | |
| parent | 056500bdc5e4243a8baa3503ec9c3fdd7323a454 (diff) | |
tests/kms_flip: don't leak the connector_config struct
... in case we can't find a compatible mode. We already have
config[0], we can't return without freeing it first.
Caught by Valgrind.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
| -rw-r--r-- | tests/kms_flip.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/kms_flip.c b/tests/kms_flip.c index b0f07541..f57462fd 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -954,8 +954,10 @@ static void connector_find_compatible_mode(int crtc_idx0, int crtc_idx1, return; if (kmstest_get_connector_config(drm_fd, o->_connector[1], - 1 << crtc_idx1, &config[1]) < 0) + 1 << crtc_idx1, &config[1]) < 0) { + kmstest_free_connector_config(&config[0]); return; + } mode[0] = &config[0].default_mode; mode[1] = &config[1].default_mode; |
