uclient-http: Handle memory allocation failure
[project/uclient.git] / uclient-http.c
index 20b8a9a..74cc9a9 100644 (file)
@@ -946,6 +946,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);