rtpgstpay: Fix memory leak

We were leaking the GList nodes of the pending buffers.

https://bugzilla.gnome.org/show_bug.cgi?id=709079
This commit is contained in:
Ognyan Tonchev 2013-09-30 12:24:32 +02:00 committed by Sebastian Dröge
parent 00056965e8
commit 93d5e182d2

View file

@ -353,15 +353,16 @@ static GstFlowReturn
gst_rtp_gst_pay_flush (GstRtpGSTPay * rtpgstpay, GstClockTime timestamp) gst_rtp_gst_pay_flush (GstRtpGSTPay * rtpgstpay, GstClockTime timestamp)
{ {
GstFlowReturn ret = GST_FLOW_OK; GstFlowReturn ret = GST_FLOW_OK;
GList *iter, *next; GList *iter;
gst_rtp_gst_pay_create_from_adapter (rtpgstpay, timestamp); gst_rtp_gst_pay_create_from_adapter (rtpgstpay, timestamp);
for (iter = rtpgstpay->pending_buffers; iter; iter = next) {
iter = rtpgstpay->pending_buffers;
while (iter) {
GstBufferList *list = iter->data; GstBufferList *list = iter->data;
next = iter->next; rtpgstpay->pending_buffers = iter =
rtpgstpay->pending_buffers = g_list_remove_link (rtpgstpay->pending_buffers, g_list_delete_link (rtpgstpay->pending_buffers, iter);
iter);
/* push the whole buffer list at once */ /* push the whole buffer list at once */
ret = gst_rtp_base_payload_push_list (GST_RTP_BASE_PAYLOAD (rtpgstpay), ret = gst_rtp_base_payload_push_list (GST_RTP_BASE_PAYLOAD (rtpgstpay),