autoconvert: Fix two memory leaks on error conditions
authorJames Stevenson <james@stev.org>
Fri, 22 Sep 2017 07:10:44 +0000 (08:10 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Fri, 22 Sep 2017 07:46:10 +0000 (08:46 +0100)
Both the sink_chain and sink_chain_list will neither pass
or free the buffer if the internal src pad doesn't exist yet.

https://bugzilla.gnome.org/show_bug.cgi?id=788035

gst/autoconvert/gstautoconvert.c

index bed5e88..5d3d565 100644 (file)
@@ -923,6 +923,7 @@ gst_auto_convert_sink_chain (GstPad * pad, GstObject * parent,
   } else {
     GST_ERROR_OBJECT (autoconvert, "Got buffer without an negotiated element,"
         " returning not-negotiated");
+    gst_buffer_unref (buffer);
   }
 
   return ret;
@@ -944,6 +945,7 @@ gst_auto_convert_sink_chain_list (GstPad * pad, GstObject * parent,
   } else {
     GST_ERROR_OBJECT (autoconvert, "Got buffer without an negotiated element,"
         " returning not-negotiated");
+    gst_buffer_list_unref (list);
   }
 
   return ret;