From ee59879da046898c18fcd3a9eaa5cafb3052b607 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Wed, 22 Jul 2009 09:59:31 +0200 Subject: [PATCH] winhttp: Check for NULL return from heap_alloc (Coverity). --- dlls/winhttp/request.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c index 344bb14a0c..83d611788a 100644 --- a/dlls/winhttp/request.c +++ b/dlls/winhttp/request.c @@ -765,6 +765,7 @@ static LPWSTR concatenate_string_list( LPCWSTR *list, int len ) len++; str = heap_alloc( len * sizeof(WCHAR) ); + if (!str) return NULL; *str = 0; for( t = list; *t ; t++ ) @@ -789,6 +790,7 @@ static LPWSTR build_header_request_string( request_t *request, LPCWSTR verb, /* allocate space for an array of all the string pointers to be added */ len = (request->num_headers) * 4 + 10; req = heap_alloc( len * sizeof(LPCWSTR) ); + if (!req) return NULL; /* add the verb, path and HTTP version string */ n = 0; @@ -820,6 +822,7 @@ static LPWSTR build_header_request_string( request_t *request, LPCWSTR verb, req[n] = NULL; requestString = concatenate_string_list( req, 4 ); heap_free( req ); + if (!requestString) return NULL; /* * Set (header) termination string for request