This is an automated email from the git hooks/post-receive script.
Git pushed a commit to branch master
in repository ffmpeg.
The following commit(s) were added to refs/heads/master by this push:
new 89e56d26ea avformat/http: fix memory leaks in httpproxy
89e56d26ea is described below
commit 89e56d26ea52ac12810e114983e6b8997caa6700
Author: Zhao Zhili <[email protected]>
AuthorDate: Wed Nov 18 20:00:58 2026 +0800
Commit: Zhao Zhili <[email protected]>
CommitDate: Thu Nov 19 02:43:52 2026 +0000
avformat/http: fix memory leaks in httpproxy
httpproxy has no priv_data_class, so ffurl_closep() never calls
av_opt_free() on its context and the AVOption fields filled in by
http_read_header() leak.
Declare the class so av_opt_free() releases those. cookie_dict,
new_location and the zlib state are not AVOptions and stay allocated,
so free them in http_proxy_close().
Fix fate-httpproxy-tunnel-eof failure.
---
libavformat/http.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libavformat/http.c b/libavformat/http.c
index cec796b46d..d549bb298b 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -2417,6 +2417,11 @@ static int http_proxy_close(URLContext *h)
HTTPContext *s = h->priv_data;
if (s->hd)
ffurl_closep(&s->hd);
+#if CONFIG_ZLIB
+ inflateEnd(&s->inflate_stream);
+#endif
+ av_dict_free(&s->cookie_dict);
+ av_freep(&s->new_location);
return 0;
}
@@ -2535,6 +2540,8 @@ static int http_proxy_read(URLContext *h, uint8_t *buf,
int size)
return ffurl_read(s->hd, buf, size);
}
+HTTP_CLASS(httpproxy);
+
const URLProtocol ff_httpproxy_protocol = {
.name = "httpproxy",
.url_open = http_proxy_open,
@@ -2543,6 +2550,7 @@ const URLProtocol ff_httpproxy_protocol = {
.url_close = http_proxy_close,
.url_get_file_handle = http_get_file_handle,
.priv_data_size = sizeof(HTTPContext),
+ .priv_data_class = &httpproxy_context_class,
.flags = URL_PROTOCOL_FLAG_NETWORK,
};
#endif /* CONFIG_HTTPPROXY_PROTOCOL */
--
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]