1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-10-03 01:21:46 +02:00

avformat/http: fix memleak

Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Zhao Zhili 2020-08-24 00:58:09 +08:00 committed by Michael Niedermayer
parent f249981976
commit 90351b5f11

View File

@ -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;