diff options
author | Tobias Schramm <tobleminer@gmail.com> | 2018-02-18 13:46:08 +0100 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2018-02-20 08:25:14 +0100 |
commit | 66fb58dff445514a53febab5a81a8a16d5ba9d56 (patch) | |
tree | b4e875fe202317ae471b9749003a9dc258a670c6 /uclient-http.c | |
parent | a73b23b4763fc51282540e33c31083413ffbb6e1 (diff) | |
download | uclient-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>
Diffstat (limited to 'uclient-http.c')
-rw-r--r-- | uclient-http.c | 3 |
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); |