libxvid_rc: fix leaks in ff_xvid_rate_control_init()
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 11 Oct 2012 15:05:04 +0000 (17:05 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 11 Oct 2012 15:08:33 +0000 (17:08 +0200)
Fixes CID733796 Part1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/libxvid_rc.c

index 0f9e50e..93aeb71 100644 (file)
@@ -57,6 +57,8 @@ int ff_xvid_rate_control_init(MpegEncContext *s){
 
         if (write(fd, tmp, strlen(tmp)) < 0) {
             av_log(NULL, AV_LOG_ERROR, "Error %s writing 2pass logfile\n", strerror(errno));
+            av_free(tmp_name);
+            close(fd);
             return AVERROR(errno);
         }
     }