encoding-target: Properly free when missing type field in parse_encoding_profile
authorJimmy Ohn <yongjin.ohn@lge.com>
Fri, 1 Dec 2023 08:55:28 +0000 (17:55 +0900)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 1 Dec 2023 15:01:41 +0000 (15:01 +0000)
pname and description in parse_encoding_profile function causes
memory leakages when missing the 'type' field for streamprofile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5750>

subprojects/gst-plugins-base/gst-libs/gst/pbutils/encoding-target.c

index bd9dcdf..1b6e60d 100644 (file)
@@ -640,6 +640,8 @@ parse_encoding_profile (GKeyFile * in, gchar * parentprofilename,
   proftype = g_key_file_get_value (in, profilename, "type", NULL);
   if (!proftype) {
     GST_WARNING ("Missing 'type' field for streamprofile %s", profilename);
+    g_free (pname);
+    g_free (description);
     return NULL;
   }