[vlc-devel] [PATCH 3/5] httpd: fix crash on allocation failure

remi at remlab.net remi at remlab.net
Sun Nov 22 17:53:26 CET 2020


From: RĂ©mi Denis-Courmont <remi at remlab.net>

---
 src/network/httpd.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/network/httpd.c b/src/network/httpd.c
index 2a893ba4ad..5a8aea918d 100644
--- a/src/network/httpd.c
+++ b/src/network/httpd.c
@@ -2037,6 +2037,12 @@ static void httpdLoop(httpd_host_t *host)
 
         cl = httpd_ClientNew(sk, now);
 
+        if (unlikely(cl == NULL))
+        {
+            vlc_tls_Close(sk);
+            continue;
+        }
+
         if (host->p_tls != NULL)
             cl->i_state = HTTPD_CLIENT_TLS_HS_OUT;
 
-- 
2.29.2



More information about the vlc-devel mailing list