summaryrefslogtreecommitdiff
path: root/ext/jpeg/gstjpegenc.c
diff options
context:
space:
mode:
authorTim-Philipp Müller <tim.muller@collabora.co.uk>2010-05-14 17:30:40 +0100
committerTim-Philipp Müller <tim.muller@collabora.co.uk>2010-05-14 17:30:40 +0100
commit035aead2d7d6d7db684d469c4fadfbdd5bcc1832 (patch)
tree59e18fa7f6df13b6ebafd6f9f424bfb01b1ed678 /ext/jpeg/gstjpegenc.c
parentdc2662e22b1d5eb39c4bba2da830b46940195467 (diff)
jpegenc: fix two leaks
Don't leak othercaps or jpegenc ref.
Diffstat (limited to 'ext/jpeg/gstjpegenc.c')
-rw-r--r--ext/jpeg/gstjpegenc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ext/jpeg/gstjpegenc.c b/ext/jpeg/gstjpegenc.c
index d8ff546ec..da2c4dafc 100644
--- a/ext/jpeg/gstjpegenc.c
+++ b/ext/jpeg/gstjpegenc.c
@@ -342,8 +342,10 @@ gst_jpegenc_getcaps (GstPad * pad)
othercaps = gst_pad_get_allowed_caps (jpegenc->srcpad);
if (othercaps == NULL ||
- gst_caps_is_empty (othercaps) || gst_caps_is_any (othercaps))
- return gst_caps_copy (gst_pad_get_pad_template_caps (pad));
+ gst_caps_is_empty (othercaps) || gst_caps_is_any (othercaps)) {
+ caps = gst_caps_copy (gst_pad_get_pad_template_caps (pad));
+ goto done;
+ }
caps = gst_caps_new_empty ();
templ = gst_pad_get_pad_template_caps (pad);
@@ -365,6 +367,10 @@ gst_jpegenc_getcaps (GstPad * pad)
gst_caps_merge_structure (caps, structure);
}
}
+
+done:
+
+ gst_caps_replace (&othercaps, NULL);
gst_object_unref (jpegenc);
return caps;