diff options
author | Steven Liu <lq@chinaffmpeg.org> | 2017-01-11 04:09:47 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2017-01-11 04:09:47 +0800 |
commit | d9c2cfd31675a6403ae4ac7c141a8185dadceb12 (patch) | |
tree | 27ba32eceebb9db72e88b93c5e1c63438ca5a293 /libavcodec/bsf.c | |
parent | f48b6b8b91d63148ef50d096688ed7226cd6ddf4 (diff) | |
download | ffmpeg-d9c2cfd31675a6403ae4ac7c141a8185dadceb12.tar.gz |
avcodec/bsf: fix resource leak in av_bsf_list_parse_str
cid: 1396268
when av_strdup(str) error, the lst need release
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavcodec/bsf.c')
-rw-r--r-- | libavcodec/bsf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c index ac2024b8db..c984526e14 100644 --- a/libavcodec/bsf.c +++ b/libavcodec/bsf.c @@ -514,8 +514,10 @@ int av_bsf_list_parse_str(const char *str, AVBSFContext **bsf_lst) if (!lst) return AVERROR(ENOMEM); - if (!(dup = buf = av_strdup(str))) - return AVERROR(ENOMEM); + if (!(dup = buf = av_strdup(str))) { + ret = AVERROR(ENOMEM); + goto end; + } while (1) { bsf_str = av_strtok(buf, ",", &saveptr); |