wrappercamerabinsrc: fix leak of drain query
authorThiago Santos <thiagoss@osg.samsung.com>
Mon, 20 Apr 2015 11:42:56 +0000 (08:42 -0300)
committerThiago Santos <thiagoss@osg.samsung.com>
Tue, 21 Apr 2015 13:00:44 +0000 (10:00 -0300)
gst_pad_peer_query doesn't take ownership of the query object

gst/camerabin2/gstwrappercamerabinsrc.c

index 731d91e..0843d85 100644 (file)
@@ -223,7 +223,10 @@ static void
 gst_wrapper_camera_bin_src_set_output (GstWrapperCameraBinSrc * self,
     GstPad * old_pad, GstPad * output_pad)
 {
-  gst_pad_peer_query (self->src_pad, gst_query_new_drain ());
+  GstQuery *drain = gst_query_new_drain ();
+  gst_pad_peer_query (self->src_pad, drain);
+  gst_query_unref (drain);
+
   if (old_pad)
     gst_ghost_pad_set_target (GST_GHOST_PAD (old_pad), NULL);
   if (output_pad)