From ef5b7ca93ef3cda83632c79d17611239190b0326 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Mon, 20 Apr 2015 08:42:56 -0300 Subject: [PATCH] wrappercamerabinsrc: fix leak of drain query gst_pad_peer_query doesn't take ownership of the query object --- gst/camerabin2/gstwrappercamerabinsrc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 731d91eb4a..0843d85785 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -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)