urlmon: Fix some memory leaks.

This commit is contained in:
Andrew Talbot 2007-10-05 21:52:08 +01:00 committed by Alexandre Julliard
parent ea5d653f3e
commit dbf995a8b4
1 changed files with 5 additions and 1 deletions

View File

@ -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);