Commit dbf995a8 authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

urlmon: Fix some memory leaks.

parent ea5d653f
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment