[vlc-commits] http: fix leak on error (fixes #25171)

Rémi Denis-Courmont git at videolan.org
Sun Oct 4 20:59:19 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Oct  4 21:59:03 2020 +0300| [9dc5028083be9fc7c746883981c822355162e0ab] | committer: Rémi Denis-Courmont

http: fix leak on error (fixes #25171)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9dc5028083be9fc7c746883981c822355162e0ab
---

 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 d31a58520e..a1fa1bdbac 100644
--- a/modules/access/http/message.c
+++ b/modules/access/http/message.c
@@ -266,7 +266,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