mirror of
https://github.com/reactos/wine.git
synced 2025-01-24 04:45:18 +00:00
urlmon: Fix some memory leaks.
This commit is contained in:
parent
ea5d653f3e
commit
dbf995a8b4
@ -318,6 +318,8 @@ static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManager *ifa
|
||||
|
||||
static const BYTE secidFile[] = {'f','i','l','e',':'};
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, buf);
|
||||
|
||||
if(*pcbSecurityId < sizeof(secidFile)+sizeof(zone))
|
||||
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
|
||||
|
||||
@ -341,8 +343,10 @@ static HRESULT WINAPI SecManagerImpl_GetSecurityId(IInternetSecurityManager *ifa
|
||||
|
||||
len = WideCharToMultiByte(CP_ACP, 0, buf, -1, NULL, 0, NULL, NULL)-1;
|
||||
|
||||
if(len+sizeof(DWORD) > *pcbSecurityId)
|
||||
if(len+sizeof(DWORD) > *pcbSecurityId) {
|
||||
HeapFree(GetProcessHeap(), 0, buf);
|
||||
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
|
||||
}
|
||||
|
||||
WideCharToMultiByte(CP_ACP, 0, buf, -1, (LPSTR)pbSecurityId, -1, NULL, NULL);
|
||||
HeapFree(GetProcessHeap(), 0, buf);
|
||||
|
Loading…
x
Reference in New Issue
Block a user