summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Schramm <tobleminer@gmail.com>2018-02-18 13:46:08 +0100
committerJohn Crispin <john@phrozen.org>2018-02-20 08:25:14 +0100
commit66fb58dff445514a53febab5a81a8a16d5ba9d56 (patch)
treeb4e875fe202317ae471b9749003a9dc258a670c6
parenta73b23b4763fc51282540e33c31083413ffbb6e1 (diff)
downloaduclient-66fb58dff445514a53febab5a81a8a16d5ba9d56.tar.gz
uclient-http: Handle memory allocation failure
Add null pointer check to allocation of uclient_http struct Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
-rw-r--r--uclient-http.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/uclient-http.c b/uclient-http.c
index 20b8a9a..74cc9a9 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -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);