[vlc-commits] http: fix leak on error (fixes #25171)
Rémi Denis-Courmont
git at videolan.org
Mon Oct 5 21:21:03 CEST 2020
vlc/vlc-3.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Oct 4 21:59:03 2020 +0300| [5136abf70dc1ca900954518b5760371e28434f05] | committer: Rémi Denis-Courmont
http: fix leak on error (fixes #25171)
(cherry picked from commit 9dc5028083be9fc7c746883981c822355162e0ab)
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=5136abf70dc1ca900954518b5760371e28434f05
---
modules/access/http/message.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/modules/access/http/message.c b/modules/access/http/message.c
index 8de2b55f33..6e10f4206e 100644
--- a/modules/access/http/message.c
+++ b/modules/access/http/message.c
@@ -265,7 +265,9 @@ struct vlc_http_msg *vlc_http_msg_iterate(struct vlc_http_msg *m)
{
struct vlc_http_msg *next = vlc_http_stream_read_headers(m->payload);
- m->payload = NULL;
+ if (next != NULL)
+ m->payload = NULL;
+
vlc_http_msg_destroy(m);
return next;
}
More information about the vlc-commits
mailing list