Re: [1/3] wininet: Check for bad allocation in HeapReAlloc
2 Jun
2009
2 Jun
'09
11:08 a.m.
Jason Green <jave27(a)gmail.com> writes:
@@ -4213,10 +4213,10 @@ static INT HTTP_GetResponseHeaders(LPWININETHTTPREQW lpwhr, BOOL clear)
/* regenerate raw headers */ while (cchRawHeaders + buflen + strlenW(szCrLf) > cchMaxRawHeaders) - { cchMaxRawHeaders *= 2; - lpszRawHeaders = HeapReAlloc(GetProcessHeap(), 0, lpszRawHeaders, (cchMaxRawHeaders+1)*sizeof(WCHAR)); - } + lpszRawHeaders = HeapReAlloc(GetProcessHeap(), 0, lpszRawHeaders, (cchMaxRawHeaders+1)*sizeof(WCHAR)); + if (lpszRawHeaders == NULL) + goto lend;
If you are going to check the allocation, then you should handle the error properly too instead of leaking memory. -- Alexandre Julliard julliard(a)winehq.org
6127
Age (days ago)
6127
Last active (days ago)
0 comments
1 participants
participants (1)
-
Alexandre Julliard