Commit 0c5726a3 authored by Jun Zhao's avatar Jun Zhao Committed by Steven Liu

lavf/hls: fix memory leak in error handling path for option tmp

fix memory leak in error handling path for option tmp.
Reviewed-by: 's avatarSteven Liu <lq@onvideo.cn>
Signed-off-by: 's avatarJun Zhao <barryjzhao@tencent.com>
parent 90a5bebd
...@@ -620,9 +620,6 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, ...@@ -620,9 +620,6 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
int ret; int ret;
int is_http = 0; int is_http = 0;
av_dict_copy(&tmp, opts, 0);
av_dict_copy(&tmp, opts2, 0);
if (av_strstart(url, "crypto", NULL)) { if (av_strstart(url, "crypto", NULL)) {
if (url[6] == '+' || url[6] == ':') if (url[6] == '+' || url[6] == ':')
proto_name = avio_find_protocol_name(url + 7); proto_name = avio_find_protocol_name(url + 7);
...@@ -655,9 +652,13 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url, ...@@ -655,9 +652,13 @@ static int open_url(AVFormatContext *s, AVIOContext **pb, const char *url,
else if (strcmp(proto_name, "file") || !strncmp(url, "file,", 5)) else if (strcmp(proto_name, "file") || !strncmp(url, "file,", 5))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
av_dict_copy(&tmp, opts, 0);
av_dict_copy(&tmp, opts2, 0);
if (is_http && c->http_persistent && *pb) { if (is_http && c->http_persistent && *pb) {
ret = open_url_keepalive(c->ctx, pb, url); ret = open_url_keepalive(c->ctx, pb, url);
if (ret == AVERROR_EXIT) { if (ret == AVERROR_EXIT) {
av_dict_free(&tmp);
return ret; return ret;
} else if (ret < 0) { } else if (ret < 0) {
if (ret != AVERROR_EOF) if (ret != AVERROR_EOF)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment