summaryrefslogtreecommitdiff
path: root/libavformat/http.c
diff options
context:
space:
mode:
authorZhao Zhili <quinkblack@foxmail.com>2020-08-24 00:58:09 +0800
committerMichael Niedermayer <michael@niedermayer.cc>2020-09-25 10:21:28 +0200
commit90351b5f11079a86230f131d30df173d4c737676 (patch)
tree90a74dd9fce5a86267c58e735ea981bcbbaa732d /libavformat/http.c
parentf249981976b18438cfb646183d4c21fb051e1ad4 (diff)
avformat/http: fix memleak
Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 6c39da1a8b..3d25d652d3 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -577,7 +577,7 @@ static int http_open(URLContext *h, const char *uri, int flags,
"No trailing CRLF found in HTTP header. Adding it.\n");
ret = av_reallocp(&s->headers, len + 3);
if (ret < 0)
- return ret;
+ goto bail_out;
s->headers[len] = '\r';
s->headers[len + 1] = '\n';
s->headers[len + 2] = '\0';
@@ -588,6 +588,7 @@ static int http_open(URLContext *h, const char *uri, int flags,
return http_listen(h, uri, flags, options);
}
ret = http_open_cnx(h, options);
+bail_out:
if (ret < 0)
av_dict_free(&s->chained_options);
return ret;