From 054f7744559c110a3c07ea0835ac59977f9bb175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Mon, 16 Jun 2014 12:02:41 +0100 Subject: [PATCH] rtptheoradepay: fix double frees Fix double-frees introduced to fix another coverity report. CID 1223053 --- gst/rtp/gstrtptheoradepay.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/gst/rtp/gstrtptheoradepay.c b/gst/rtp/gstrtptheoradepay.c index ec4011fd53..ccfe12dbdd 100644 --- a/gst/rtp/gstrtptheoradepay.c +++ b/gst/rtp/gstrtptheoradepay.c @@ -570,20 +570,16 @@ gst_rtp_theora_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf) break; } - g_free (to_free); - if (rtptheoradepay->needs_keyframe) goto request_keyframe; +out: +no_output: + gst_rtp_buffer_unmap (&rtp); + g_free (to_free); return NULL; -no_output: - { - gst_rtp_buffer_unmap (&rtp); - g_free (to_free); - return NULL; - } /* ERORRS */ switch_failed: { @@ -600,9 +596,7 @@ packet_short: ignore_reserved: { GST_WARNING_OBJECT (rtptheoradepay, "reserved TDT ignored"); - gst_rtp_buffer_unmap (&rtp); - g_free (to_free); - return NULL; + goto out; } length_short: { @@ -623,9 +617,7 @@ request_config: gst_event_new_custom (GST_EVENT_CUSTOM_UPSTREAM, gst_structure_new ("GstForceKeyUnit", "all-headers", G_TYPE_BOOLEAN, TRUE, NULL))); - gst_rtp_buffer_unmap (&rtp); - g_free (to_free); - return NULL; + goto out; } request_keyframe: { @@ -633,9 +625,7 @@ request_keyframe: gst_pad_push_event (GST_RTP_BASE_DEPAYLOAD_SINKPAD (depayload), gst_event_new_custom (GST_EVENT_CUSTOM_UPSTREAM, gst_structure_new_empty ("GstForceKeyUnit"))); - gst_rtp_buffer_unmap (&rtp); - g_free (to_free); - return NULL; + goto out; } }