summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshish Kumar <kr.ashish@samsung.com>2017-10-03 13:57:24 +0530
committerTim-Philipp Müller <tim@centricular.com>2018-03-23 17:04:49 +0000
commit4be1a2532055f4417d89c4845e7f16f53465e163 (patch)
tree6215add450e7ec414bc2224b3df2787f8446e5a6
parent2a1098380969a52c2a89abfe52f0d034638a4e69 (diff)
downloadgst-libav-4be1a2532055f4417d89c4845e7f16f53465e163.tar.gz
avprotocol: fix leak in error code paths
https://bugzilla.gnome.org/show_bug.cgi?id=788481
-rw-r--r--ext/libav/gstavprotocol.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/libav/gstavprotocol.c b/ext/libav/gstavprotocol.c
index d106f9b..249b240 100644
--- a/ext/libav/gstavprotocol.c
+++ b/ext/libav/gstavprotocol.c
@@ -244,6 +244,7 @@ gst_ffmpegdata_open (GstPad * pad, int flags, AVIOContext ** context)
/* we don't support R/W together */
if ((flags & AVIO_FLAG_WRITE) && (flags & AVIO_FLAG_READ)) {
GST_WARNING ("Only read-only or write-only are supported");
+ g_free (info);
return -EINVAL;
}
@@ -262,6 +263,7 @@ gst_ffmpegdata_open (GstPad * pad, int flags, AVIOContext ** context)
buffer = av_malloc (buffer_size);
if (buffer == NULL) {
GST_WARNING ("Failed to allocate buffer");
+ g_free (info);
return -ENOMEM;
}
@@ -270,6 +272,7 @@ gst_ffmpegdata_open (GstPad * pad, int flags, AVIOContext ** context)
gst_ffmpegdata_read, gst_ffmpegdata_write, gst_ffmpegdata_seek);
if (*context == NULL) {
GST_WARNING ("Failed to allocate memory");
+ g_free (info);
av_free (buffer);
return -ENOMEM;
}