Add null pointer check to allocation of uclient_http struct

Signed-off-by: Tobias Schramm <[email protected]>
---
 uclient-http.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/uclient-http.c b/uclient-http.c
index 04f16a3..b6607f1 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -949,6 +949,9 @@ static struct uclient *uclient_http_alloc(void)
        struct uclient_http *uh;
 
        uh = calloc_a(sizeof(*uh));
+       if (!uh)
+               return NULL;
+
        uh->disconnect_t.cb = uclient_http_disconnect_cb;
        blob_buf_init(&uh->headers, 0);
 
-- 
2.16.1
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to