[vlc-commits] httpd: handle one error
Rémi Denis-Courmont
git at videolan.org
Sun Jun 17 20:13:19 CEST 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | 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);
More information about the vlc-commits
mailing list