From f7828bc6c4c3717868eff557c6b92ad4f02c0efe Mon Sep 17 00:00:00 2001
From: Ludovico de Nittis <ludovico.denittis@collabora.com>
Date: Mon, 20 Apr 2020 09:46:02 +0200
Subject: [PATCH] check-va-api.c: Fix config memory leak

Signed-off-by: Ludovico de Nittis <ludovico.denittis@collabora.com>
---
 helpers/check-va-api.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/helpers/check-va-api.c b/helpers/check-va-api.c
index 172e1c98a..67a8512ad 100644
--- a/helpers/check-va-api.c
+++ b/helpers/check-va-api.c
@@ -105,7 +105,7 @@ main (int argc,
   VASurfaceID *surfaces = NULL;
   VAImageFormat image_format;
   VAProfile *profiles = NULL;
-  VAConfigID config;
+  VAConfigID config = VA_INVALID_ID;
   VAContextID context = VA_INVALID_ID;
   VABufferID misc_buf_id = VA_INVALID_ID;
   VABufferID pipeline_param_buf_id = VA_INVALID_ID;
@@ -283,6 +283,8 @@ out:
         vaDestroyContext (va_display, context);
       if (img.image_id != VA_INVALID_ID)
         vaDestroyImage (va_display, img.image_id);
+      if (config != VA_INVALID_ID)
+        vaDestroyConfig(va_display, config);
       if (surfaces)
         vaDestroySurfaces (va_display, surfaces, surfaces_count);
 
-- 
GitLab