[FFmpeg-cvslog] cmdutils: fix unclosed file on error

Michael Niedermayer git at videolan.org
Thu Oct 25 01:39:23 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Oct 25 00:32:34 2012 +0200| [0008e0d6321de1a6a51dafd28103d9fd5a9be325] | committer: Michael Niedermayer

cmdutils: fix unclosed file on error

Fixes CID739865
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0008e0d6321de1a6a51dafd28103d9fd5a9be325
---

 cmdutils.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/cmdutils.c b/cmdutils.c
index a504ca5..e9565d2 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1315,6 +1315,7 @@ int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
     fseek(f, 0, SEEK_SET);
     if (*size == (size_t)-1) {
         av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", strerror(errno));
+        fclose(f);
         return AVERROR(errno);
     }
     *bufptr = av_malloc(*size + 1);



More information about the ffmpeg-cvslog mailing list