From e23f9bb4e9556fecf6046c6d8f19b6c2cb6b2f30 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Tue, 8 Feb 2005 10:58:13 +0000 Subject: gst/law/: Fix caps memleaks (#166600). Original commit message from CVS: Reviewed by: Ronald S. Bultje * gst/law/alaw-decode.c: (alawdec_link): * gst/law/alaw-encode.c: (alawenc_link): * gst/law/mulaw-decode.c: (mulawdec_link): * gst/law/mulaw-encode.c: (mulawenc_link): Fix caps memleaks (#166600). --- ChangeLog | 10 ++++++++++ gst/law/alaw-decode.c | 7 ++++++- gst/law/alaw-encode.c | 7 ++++++- gst/law/mulaw-decode.c | 9 ++++++++- gst/law/mulaw-encode.c | 7 ++++++- 5 files changed, 36 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed95b36e..74f88f21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2005-02-08 Francis Labonte + + Reviewed by: Ronald S. Bultje + + * gst/law/alaw-decode.c: (alawdec_link): + * gst/law/alaw-encode.c: (alawenc_link): + * gst/law/mulaw-decode.c: (mulawdec_link): + * gst/law/mulaw-encode.c: (mulawenc_link): + Fix caps memleaks (#166600). + 2005-02-08 Tim-Philipp Müller * ext/tarkin/mem.h: diff --git a/gst/law/alaw-decode.c b/gst/law/alaw-decode.c index 2a3a1371..44a6cb84 100644 --- a/gst/law/alaw-decode.c +++ b/gst/law/alaw-decode.c @@ -118,6 +118,7 @@ alawdec_link (GstPad * pad, const GstCaps * caps) GstStructure *structure; const GValue *rate, *chans; GstCaps *base_caps; + GstPadLinkReturn link_return; structure = gst_caps_get_structure (caps, 0); rate = gst_structure_get_value (structure, "rate"); @@ -140,7 +141,11 @@ alawdec_link (GstPad * pad, const GstCaps * caps) gst_structure_set_value (structure, "rate", rate); gst_structure_set_value (structure, "channels", chans); - return gst_pad_try_set_caps (otherpad, base_caps); + link_return = gst_pad_try_set_caps (otherpad, base_caps); + + gst_caps_free (base_caps); + + return link_return; } GType diff --git a/gst/law/alaw-encode.c b/gst/law/alaw-encode.c index e3e65000..b4cd6432 100644 --- a/gst/law/alaw-encode.c +++ b/gst/law/alaw-encode.c @@ -160,6 +160,7 @@ alawenc_link (GstPad * pad, const GstCaps * caps) GstStructure *structure; const GValue *rate, *chans; GstCaps *base_caps; + GstPadLinkReturn link_return; structure = gst_caps_get_structure (caps, 0); rate = gst_structure_get_value (structure, "rate"); @@ -182,7 +183,11 @@ alawenc_link (GstPad * pad, const GstCaps * caps) gst_structure_set_value (structure, "rate", rate); gst_structure_set_value (structure, "channels", chans); - return gst_pad_try_set_caps (otherpad, base_caps); + link_return = gst_pad_try_set_caps (otherpad, base_caps); + + gst_caps_free (base_caps); + + return link_return; } GType diff --git a/gst/law/mulaw-decode.c b/gst/law/mulaw-decode.c index a3544a6c..35c365f1 100644 --- a/gst/law/mulaw-decode.c +++ b/gst/law/mulaw-decode.c @@ -95,6 +95,8 @@ mulawdec_link (GstPad * pad, const GstCaps * caps) GstStructure *structure; const GValue *rate, *chans; GstCaps *base_caps; + GstPadLinkReturn link_return; + structure = gst_caps_get_structure (caps, 0); rate = gst_structure_get_value (structure, "rate"); @@ -117,7 +119,12 @@ mulawdec_link (GstPad * pad, const GstCaps * caps) gst_structure_set_value (structure, "rate", rate); gst_structure_set_value (structure, "channels", chans); - return gst_pad_try_set_caps (otherpad, base_caps); + link_return = gst_pad_try_set_caps (otherpad, base_caps); + + gst_caps_free (base_caps); + + return link_return; + } GType diff --git a/gst/law/mulaw-encode.c b/gst/law/mulaw-encode.c index 0166b30e..305165b8 100644 --- a/gst/law/mulaw-encode.c +++ b/gst/law/mulaw-encode.c @@ -94,6 +94,7 @@ mulawenc_link (GstPad * pad, const GstCaps * caps) GstStructure *structure; const GValue *rate, *chans; GstCaps *base_caps; + GstPadLinkReturn link_return; structure = gst_caps_get_structure (caps, 0); rate = gst_structure_get_value (structure, "rate"); @@ -116,7 +117,11 @@ mulawenc_link (GstPad * pad, const GstCaps * caps) gst_structure_set_value (structure, "rate", rate); gst_structure_set_value (structure, "channels", chans); - return gst_pad_try_set_caps (otherpad, base_caps); + link_return = gst_pad_try_set_caps (otherpad, base_caps); + + gst_caps_free (base_caps); + + return link_return; } GType -- cgit