diff options
author | Luis de Bethencourt <luis.bg@samsung.com> | 2015-02-10 13:29:32 +0000 |
---|---|---|
committer | Luis de Bethencourt <luis.bg@samsung.com> | 2015-02-10 13:33:09 +0000 |
commit | 0373fd8f65ec681c6dc781c20785a990d176dea2 (patch) | |
tree | f24fe57407e288aa744b11dfb3ced402743b2699 | |
parent | 603c1d71a1b0f415b93511959cef29a84d2ea09d (diff) |
splitmux: fix memory leak
If execution goes to the beach in line 981, buf_info goes out of scope without
the memory being free'd. Handle this case.
CID #1268403
-rw-r--r-- | gst/multifile/gstsplitmuxsink.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gst/multifile/gstsplitmuxsink.c b/gst/multifile/gstsplitmuxsink.c index 9034a1949..8f39675b1 100644 --- a/gst/multifile/gstsplitmuxsink.c +++ b/gst/multifile/gstsplitmuxsink.c @@ -909,7 +909,7 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx) { GstSplitMuxSink *splitmux = ctx->splitmux; GstBuffer *buf; - MqStreamBuf *buf_info; + MqStreamBuf *buf_info = NULL; GstClockTime ts; gboolean loop_again; gboolean keyframe = FALSE; @@ -1090,9 +1090,13 @@ handle_mq_input (GstPad * pad, GstPadProbeInfo * info, MqStreamCtx * ctx) GST_LOG_OBJECT (pad, "Returning to queue buffer %" GST_PTR_FORMAT " run ts %" GST_TIME_FORMAT, buf, GST_TIME_ARGS (ctx->in_running_time)); -beach: GST_SPLITMUX_UNLOCK (splitmux); + return GST_PAD_PROBE_PASS; +beach: + GST_SPLITMUX_UNLOCK (splitmux); + if (buf_info) + mq_stream_buf_free (buf_info); return GST_PAD_PROBE_PASS; } |