From bde4b0738c7827cceceb34715b0bddb781271031 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 16 Feb 2015 06:24:06 +0100 Subject: [PATCH] (net_http.c) net_http_new - add goto fail in case malloc fails --- net_http.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net_http.c b/net_http.c index 8d53b635ff..ec00f5c0f4 100644 --- a/net_http.c +++ b/net_http.c @@ -245,6 +245,9 @@ struct http_t *net_http_new(const char * url) state->buflen = 512; state->data = (char*)malloc(state->buflen); + if (!state->data) + goto fail; + return state; fail: