OSDN Git Service

avdevice/iec61883: free packet on buffer allocation error
authorMarton Balint <cus@passwd.hu>
Wed, 8 Feb 2017 22:37:42 +0000 (23:37 +0100)
committerMarton Balint <cus@passwd.hu>
Sun, 19 Feb 2017 15:41:43 +0000 (16:41 +0100)
Fixes Coverity CID 1396416.

Signed-off-by: Marton Balint <cus@passwd.hu>
libavdevice/iec61883.c

index c45ae9a..721dca3 100644 (file)
@@ -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;
     }