Marcus Meissner : winhttp: Check for NULL return from heap_alloc (Coverity) .
Alexandre Julliard
julliard at winehq.org
Wed Jul 22 09:34:47 CDT 2009
Module: wine
Branch: master
Commit: ee59879da046898c18fcd3a9eaa5cafb3052b607
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ee59879da046898c18fcd3a9eaa5cafb3052b607
Author: Marcus Meissner <marcus at jet.franken.de>
Date: Wed Jul 22 09:59:31 2009 +0200
winhttp: Check for NULL return from heap_alloc (Coverity).
---
dlls/winhttp/request.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index 344bb14..83d6117 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
More information about the wine-cvs
mailing list