projects
/
project
/
uclient.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a73b23b
)
uclient-http: Handle memory allocation failure
author
Tobias Schramm
<tobleminer@gmail.com>
Sun, 18 Feb 2018 12:46:08 +0000
(13:46 +0100)
committer
John Crispin
<john@phrozen.org>
Tue, 20 Feb 2018 07:25:14 +0000
(08:25 +0100)
Add null pointer check to allocation of uclient_http struct
Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
uclient-http.c
patch
|
blob
|
history
diff --git
a/uclient-http.c
b/uclient-http.c
index 20b8a9a71cf95409d7967a9977eb2a6606a0b0a2..74cc9a9ab1152a6e14d561d20d1d6f45e8ceab8c 100644
(file)
--- 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);