validate: Plug some leaks
authorThibault Saunier <tsaunier@igalia.com>
Wed, 21 Sep 2022 14:44:59 +0000 (11:44 -0300)
committerThibault Saunier <tsaunier@igalia.com>
Tue, 11 Oct 2022 14:48:09 +0000 (11:48 -0300)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3059>

subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c

index e9ef125..5a6b6fd 100644 (file)
@@ -3216,7 +3216,7 @@ set_env_var (GQuark field_id, GValue * value,
 static GstValidateExecuteActionReturn
 _run_command (GstValidateScenario * scenario, GstValidateAction * action)
 {
-  gchar **argv = NULL, *_stderr;
+  gchar **argv = NULL, *_stderr = NULL;
   GError *error = NULL;
   const GValue *env = NULL;
   GSubprocess *subproc = NULL;
@@ -3254,6 +3254,8 @@ _run_command (GstValidateScenario * scenario, GstValidateAction * action)
   REPORT_UNLESS (g_subprocess_get_exit_status (subproc) == 0,
       done, "Sub command failed. Stderr: %s", _stderr);
 
+  g_free (_stderr);
+
   res = GST_VALIDATE_EXECUTE_ACTION_OK;
 
 done:
@@ -3758,6 +3760,8 @@ _execute_appsrc_push (GstValidateScenario * scenario,
       segment.stop = tmp;
     gst_structure_get_double (segment_struct, "rate", &segment.rate);
 
+    gst_structure_free (segment_struct);
+
     gst_sample_set_segment (sample, &segment);
   }