diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2012-10-25 21:33:45 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2012-10-25 21:35:40 +0200 |
commit | b19bfd6c9f42588c7a172bb019e27696972b8d2c (patch) | |
tree | 59708908dce1f0ef83b3c83c8f0c410856c2a3d1 /libavdevice | |
parent | 48ec8b25a7deb1a12cd06a064d2bc16440bcbe92 (diff) | |
download | ffmpeg-b19bfd6c9f42588c7a172bb019e27696972b8d2c.tar.gz |
lavd/lavfi: fix leak in case of failure
Jump to the common release code in case of failure.
Diffstat (limited to 'libavdevice')
-rw-r--r-- | libavdevice/lavfi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index 070aff565c..f4a54148c4 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -109,7 +109,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) if (lavfi->graph_filename && lavfi->graph_str) { av_log(avctx, AV_LOG_ERROR, "Only one of the graph or graph_file options must be specified\n"); - return AVERROR(EINVAL); + FAIL(AVERROR(EINVAL)); } if (lavfi->graph_filename) { @@ -118,13 +118,13 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) ret = av_file_map(lavfi->graph_filename, &file_buf, &file_bufsize, 0, avctx); if (ret < 0) - return ret; + goto end; /* create a 0-terminated string based on the read file */ graph_buf = av_malloc(file_bufsize + 1); if (!graph_buf) { av_file_unmap(file_buf, file_bufsize); - return AVERROR(ENOMEM); + FAIL(AVERROR(ENOMEM)); } memcpy(graph_buf, file_buf, file_bufsize); graph_buf[file_bufsize] = 0; |