wininet: Fix memory leak in HTTP_DeleteCustomHeader.
Free the memory associated with the field and value of the custom header otherwise it will be leaked. Found by Valgrind.
This commit is contained in:
parent
24ec4a6ed7
commit
62e0a8ca38
|
@ -4141,6 +4141,9 @@ static BOOL HTTP_DeleteCustomHeader(LPWININETHTTPREQW lpwhr, DWORD index)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
lpwhr->nCustHeaders--;
|
lpwhr->nCustHeaders--;
|
||||||
|
|
||||||
|
HeapFree(GetProcessHeap(), 0, lpwhr->pCustHeaders[index].lpszField);
|
||||||
|
HeapFree(GetProcessHeap(), 0, lpwhr->pCustHeaders[index].lpszValue);
|
||||||
|
|
||||||
memmove( &lpwhr->pCustHeaders[index], &lpwhr->pCustHeaders[index+1],
|
memmove( &lpwhr->pCustHeaders[index], &lpwhr->pCustHeaders[index+1],
|
||||||
(lpwhr->nCustHeaders - index)* sizeof(HTTPHEADERW) );
|
(lpwhr->nCustHeaders - index)* sizeof(HTTPHEADERW) );
|
||||||
memset( &lpwhr->pCustHeaders[lpwhr->nCustHeaders], 0, sizeof(HTTPHEADERW) );
|
memset( &lpwhr->pCustHeaders[lpwhr->nCustHeaders], 0, sizeof(HTTPHEADERW) );
|
||||||
|
|
Loading…
Reference in New Issue