[FFmpeg-cvslog] av_tempfile: fix leak in error case

Michael Niedermayer git at videolan.org
Thu Oct 11 17:16:09 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Oct 11 17:09:57 2012 +0200| [c9454cb643f5404ca8f4f02e1384c863136f7a9e] | committer: Michael Niedermayer

av_tempfile: fix leak in error case

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

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

 libavutil/file.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavutil/file.c b/libavutil/file.c
index 8dbeab6..5aa4b9c 100644
--- a/libavutil/file.c
+++ b/libavutil/file.c
@@ -175,6 +175,7 @@ int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_c
     if (fd < 0) {
         int err = AVERROR(errno);
         av_log(&file_log_ctx, AV_LOG_ERROR, "ff_tempfile: Cannot open temporary file %s\n", *filename);
+        av_freep(filename);
         return err;
     }
     return fd; /* success */



More information about the ffmpeg-cvslog mailing list