提交 59f809e9 编写于 作者: N Nicolas George

lavf/tee: fix leak of strdup/strtoked buffer.

Fix CID 1108606.
上级 ab2bfb85
...@@ -102,10 +102,10 @@ fail: ...@@ -102,10 +102,10 @@ fail:
static int parse_bsfs(void *log_ctx, const char *bsfs_spec, static int parse_bsfs(void *log_ctx, const char *bsfs_spec,
AVBitStreamFilterContext **bsfs) AVBitStreamFilterContext **bsfs)
{ {
char *bsf_name, *buf, *saveptr; char *bsf_name, *buf, *dup, *saveptr;
int ret = 0; int ret = 0;
if (!(buf = av_strdup(bsfs_spec))) if (!(dup = buf = av_strdup(bsfs_spec)))
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
while (bsf_name = av_strtok(buf, ",", &saveptr)) { while (bsf_name = av_strtok(buf, ",", &saveptr)) {
...@@ -128,7 +128,7 @@ static int parse_bsfs(void *log_ctx, const char *bsfs_spec, ...@@ -128,7 +128,7 @@ static int parse_bsfs(void *log_ctx, const char *bsfs_spec,
} }
end: end:
av_free(buf); av_free(dup);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册