diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 8242559fce..e9e79f4f17 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -1285,9 +1285,11 @@ gst_queue_handle_src_event (GstPad * pad, GstEvent * event) { gboolean res = TRUE; GstQueue *queue = GST_QUEUE (gst_pad_get_parent (pad)); - if (G_UNLIKELY (queue == NULL)) - return FALSE; + if (G_UNLIKELY (queue == NULL)) { + gst_event_unref (event); + return FALSE; + } #ifndef GST_DISABLE_GST_DEBUG GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%d)", event, GST_EVENT_TYPE (event)); diff --git a/plugins/elements/gstqueue2.c b/plugins/elements/gstqueue2.c index 64b9afbb43..0a2b28c0dd 100644 --- a/plugins/elements/gstqueue2.c +++ b/plugins/elements/gstqueue2.c @@ -2365,9 +2365,11 @@ gst_queue2_handle_src_event (GstPad * pad, GstEvent * event) { gboolean res = TRUE; GstQueue2 *queue = GST_QUEUE2 (gst_pad_get_parent (pad)); - if (G_UNLIKELY (queue == NULL)) - return FALSE; + if (G_UNLIKELY (queue == NULL)) { + gst_event_unref (event); + return FALSE; + } #ifndef GST_DISABLE_GST_DEBUG GST_CAT_DEBUG_OBJECT (queue_dataflow, queue, "got event %p (%s)", event, GST_EVENT_TYPE_NAME (event));