From f5e315226237e55976970e5f7e258603de518995 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 11 Dec 2007 16:26:07 +0000 Subject: [PATCH] [MOVED FROM BAD 06/28] ext/x264/gstx264enc.c: Fix caps memleak. Original commit message from CVS: * ext/x264/gstx264enc.c: (gst_x264_enc_set_src_caps): Fix caps memleak. --- ext/x264/gstx264enc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c index 70b94a7..92f003b 100644 --- a/ext/x264/gstx264enc.c +++ b/ext/x264/gstx264enc.c @@ -285,6 +285,8 @@ gst_x264_enc_set_src_caps (GstX264Enc * encoder, GstPad * pad, GstCaps * caps) GstStructure *structure; GValue header = { 0, }; GstBuffer *buf; + GstCaps *outcaps; + gboolean res; structure = gst_caps_get_structure (caps, 0); structure = gst_structure_copy (structure); @@ -301,8 +303,11 @@ gst_x264_enc_set_src_caps (GstX264Enc * encoder, GstPad * pad, GstCaps * caps) } } - /* FIXME: doesn't this leak? (tpm) */ - return gst_pad_set_caps (pad, gst_caps_new_full (structure, NULL)); + outcaps = gst_caps_new_full (structure, NULL); + res = gst_pad_set_caps (pad, outcaps); + gst_caps_unref (outcaps); + + return res; } static gboolean -- 2.7.4