queue2: fix memory leak

unmap the buffer memory on errors.
This commit is contained in:
Wim Taymans 2012-01-27 15:32:37 +01:00
parent 166f6e1cc5
commit fe9e284463

View file

@ -1288,12 +1288,14 @@ gst_queue2_create_read (GstQueue2 * queue, guint64 offset, guint length,
hit_eos: hit_eos:
{ {
GST_DEBUG_OBJECT (queue, "EOS hit and we don't have any requested data"); GST_DEBUG_OBJECT (queue, "EOS hit and we don't have any requested data");
gst_buffer_unmap (buf, &info);
gst_buffer_unref (buf); gst_buffer_unref (buf);
return GST_FLOW_EOS; return GST_FLOW_EOS;
} }
out_flushing: out_flushing:
{ {
GST_DEBUG_OBJECT (queue, "we are flushing"); GST_DEBUG_OBJECT (queue, "we are flushing");
gst_buffer_unmap (buf, &info);
gst_buffer_unref (buf); gst_buffer_unref (buf);
return GST_FLOW_WRONG_STATE; return GST_FLOW_WRONG_STATE;
} }