rtpmux: Fix leak

Fixed a leak discovered by Laurent Glayal <spegle@yahoo.fr>
This commit is contained in:
Olivier Crête 2009-04-28 16:03:19 -04:00
parent 905aad3572
commit 6c4eeff781

View file

@ -431,12 +431,16 @@ same_clock_rate_fold (gpointer item, GValue * ret, gpointer user_data)
const GstCaps *accumcaps; const GstCaps *accumcaps;
GstCaps *intersect; GstCaps *intersect;
if (pad == mypad) if (pad == mypad) {
gst_object_unref (pad);
return TRUE; return TRUE;
}
peercaps = gst_pad_peer_get_caps (pad); peercaps = gst_pad_peer_get_caps (pad);
if (!peercaps) if (!peercaps) {
gst_object_unref (pad);
return TRUE; return TRUE;
}
othercaps = gst_caps_intersect (peercaps, othercaps = gst_caps_intersect (peercaps,
gst_pad_get_pad_template_caps (pad)); gst_pad_get_pad_template_caps (pad));
@ -451,6 +455,7 @@ same_clock_rate_fold (gpointer item, GValue * ret, gpointer user_data)
g_value_take_boxed (ret, intersect); g_value_take_boxed (ret, intersect);
gst_caps_unref (othercaps); gst_caps_unref (othercaps);
gst_object_unref (pad);
return !gst_caps_is_empty (intersect); return !gst_caps_is_empty (intersect);
} }