mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 08:50:49 +00:00
wininet: Simplify memory allocation in HTTP_InsertCustomHeader.
This commit is contained in:
parent
5cf0d97416
commit
6905b76b94
|
@ -6280,15 +6280,7 @@ static DWORD HTTP_InsertCustomHeader(http_request_t *request, LPHTTPHEADERW lpHd
|
||||||
|
|
||||||
TRACE("--> %s: %s\n", debugstr_w(lpHdr->lpszField), debugstr_w(lpHdr->lpszValue));
|
TRACE("--> %s: %s\n", debugstr_w(lpHdr->lpszField), debugstr_w(lpHdr->lpszValue));
|
||||||
count = request->nCustHeaders + 1;
|
count = request->nCustHeaders + 1;
|
||||||
if (count > 1)
|
lph = realloc(request->custHeaders, sizeof(HTTPHEADERW) * count);
|
||||||
{
|
|
||||||
lph = realloc(request->custHeaders, sizeof(HTTPHEADERW) * count);
|
|
||||||
memset(lph + request->nCustHeaders, 0, sizeof(HTTPHEADERW));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
lph = calloc(count, sizeof(HTTPHEADERW));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!lph)
|
if (!lph)
|
||||||
return ERROR_OUTOFMEMORY;
|
return ERROR_OUTOFMEMORY;
|
||||||
|
|
Loading…
Reference in a new issue