av_tempfile: fix leak in error case

Fixes CID733796 Part2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c9454cb643)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-10-11 17:09:57 +02:00
parent 7450a0215a
commit 8a525e4d18
1 changed files with 1 additions and 0 deletions

View File

@ -171,6 +171,7 @@ int av_tempfile(const char *prefix, char **filename, int log_offset, void *log_c
if (fd < 0) { if (fd < 0) {
int err = AVERROR(errno); int err = AVERROR(errno);
av_log(&file_log_ctx, AV_LOG_ERROR, "ff_tempfile: Cannot open temporary file %s\n", *filename); av_log(&file_log_ctx, AV_LOG_ERROR, "ff_tempfile: Cannot open temporary file %s\n", *filename);
av_freep(filename);
return err; return err;
} }
return fd; /* success */ return fd; /* success */