vlc | branch: master | Rémi Denis-Courmont <[email protected]> | Sun Jun 17 
21:11:28 2018 +0300| [f340f5ef40699a084b9553dd8e0afaddca17473e] | committer: 
Rémi Denis-Courmont

httpd: handle one error

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

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

diff --git a/src/network/httpd.c b/src/network/httpd.c
index 56170c5af6..f6c1cc4cc2 100644
--- a/src/network/httpd.c
+++ b/src/network/httpd.c
@@ -1047,7 +1047,12 @@ httpd_url_t *httpd_UrlNew(httpd_host_t *host, const char 
*psz_url,
             return NULL;
         }
 
-    url = xmalloc(sizeof(httpd_url_t));
+    url = malloc(sizeof (*url));
+    if (unlikely(url == NULL)) {
+        vlc_mutex_unlock(&host->lock);
+        return NULL;
+    }
+
     url->host = host;
 
     vlc_mutex_init(&url->lock);

_______________________________________________
vlc-commits mailing list
[email protected]
https://mailman.videolan.org/listinfo/vlc-commits

Reply via email to