From 66fb58dff445514a53febab5a81a8a16d5ba9d56 Mon Sep 17 00:00:00 2001 From: Tobias Schramm Date: Sun, 18 Feb 2018 13:46:08 +0100 Subject: [PATCH] uclient-http: Handle memory allocation failure Add null pointer check to allocation of uclient_http struct Signed-off-by: Tobias Schramm --- uclient-http.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.25.1