audio-converter: Free config when gst_audio_converter_new fails
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
Thu, 6 May 2021 16:22:45 +0000 (18:22 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 25 Jun 2021 13:55:39 +0000 (13:55 +0000)
The config got leaked when parameter validation fails.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1140>

gst-libs/gst/audio/audio-converter.c

index c6d151f..ed93e31 100644 (file)
@@ -1434,12 +1434,14 @@ gst_audio_converter_new (GstAudioConverterFlags flags, GstAudioInfo * in_info,
 unpositioned:
   {
     GST_WARNING ("unpositioned channels");
+    g_clear_pointer (&config, gst_structure_free);
     return NULL;
   }
 
 invalid_mix_matrix:
   {
     GST_WARNING ("Invalid mix matrix");
+    g_clear_pointer (&config, gst_structure_free);
     return NULL;
   }
 }