[FFmpeg-devel] [PATCH 2/3] avdevice/iec61883: free packet on buffer allocation error

Marton Balint cus at passwd.hu
Thu Feb 9 01:23:24 EET 2017


Fixes Coverity CID 1396416.

Signed-off-by: Marton Balint <cus at passwd.hu>
---
 libavdevice/iec61883.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavdevice/iec61883.c b/libavdevice/iec61883.c
index c45ae9a..721dca3 100644
--- a/libavdevice/iec61883.c
+++ b/libavdevice/iec61883.c
@@ -120,6 +120,7 @@ static int iec61883_callback(unsigned char *data, int length,
 
     packet->buf = av_malloc(length);
     if (!packet->buf) {
+        av_free(packet);
         ret = -1;
         goto exit;
     }
-- 
2.10.2



More information about the ffmpeg-devel mailing list