From: David Woodhouse Date: Mon, 22 Feb 2010 14:09:25 +0000 (+0000) Subject: Handle allocation failure in HTTP 1.0 loop X-Git-Tag: v2.22~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7b025a2ebfd13688e59bc76b40f22594b3241ca6;p=platform%2Fupstream%2Fopenconnect.git Handle allocation failure in HTTP 1.0 loop Signed-off-by: David Woodhouse --- diff --git a/http.c b/http.c index 2072001..2084e88 100644 --- a/http.c +++ b/http.c @@ -269,9 +269,13 @@ static int process_http_response(struct openconnect_info *vpninfo, int *result, /* HTTP 1.0 response. Just eat all we can in 16KiB chunks */ while (1) { body = realloc(body, done + 16384); + if (!body) + return -ENOMEM; i = SSL_read(vpninfo->https_ssl, body + done, 16384); if (i <= 0) { body = realloc(body, done + 1); + if (!body) + return -ENOMEM; break; } done += i;