From 80de32b017d8eb4110f3a1695385353a7105066e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 19 Aug 2020 17:18:26 +0200 Subject: [PATCH] va: utils: free allocated string and fix a memleak Part-of: --- sys/va/gstvautils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/va/gstvautils.c b/sys/va/gstvautils.c index 24d5d08c93..95bfaee44b 100644 --- a/sys/va/gstvautils.c +++ b/sys/va/gstvautils.c @@ -294,10 +294,13 @@ gst_context_get_va_display (GstContext * context, const gchar * type_name, s = gst_context_get_structure (context); if (gst_structure_get (s, "gst-display", GST_TYPE_VA_DISPLAY, &display, NULL)) { gchar *device_path = NULL; + gboolean ret; if (GST_IS_VA_DISPLAY_DRM (display)) { g_object_get (display, "path", &device_path, NULL); - if (g_strcmp0 (device_path, render_device_path) == 0) + ret = (g_strcmp0 (device_path, render_device_path) == 0); + g_free (device_path); + if (ret) goto accept; } else if (!is_devnode) { goto accept;