ges-structure-parser: Don't leak failed strings
authorEdward Hervey <edward@centricular.com>
Wed, 16 Nov 2022 11:45:27 +0000 (12:45 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Fri, 18 Nov 2022 07:22:23 +0000 (07:22 +0000)
We pass the ownership of current_string to the list of wrong strings, it will be
cleared then.

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

subprojects/gst-editing-services/ges/ges-structure-parser.c

index d84d64b..dcc564b 100644 (file)
@@ -110,8 +110,8 @@ _finish_structure (GESStructureParser * self)
     GST_ERROR ("Could not parse %s", self->current_string);
 
     self->wrong_strings = g_list_append (self->wrong_strings,
-        g_strdup (self->current_string));
-
+        self->current_string);
+    self->current_string = NULL;
     return;
   }