Missing HeapFree's + 1 LocalFree (found by smatch).

This commit is contained in:
Michael Stefaniuc 2004-12-14 11:38:50 +00:00 committed by Alexandre Julliard
parent 398a595377
commit 1493433e38
7 changed files with 16 additions and 2 deletions

View File

@ -121,8 +121,10 @@ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR what)
TRACE("extracting to dir: %s\n", debugstr_a(dir));
/* FIXME: what to do on failure? */
if (!process_cabinet(what, dir, FALSE, FALSE, dest))
if (!process_cabinet(what, dir, FALSE, FALSE, dest)) {
LocalFree(dir);
return E_OUTOFMEMORY;
}
LocalFree(dir);

View File

@ -2803,6 +2803,7 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count,
tmpPtBlock = HeapAlloc( GetProcessHeap(), 0, sizeof(POINTBLOCK));
if(!tmpPtBlock) {
WARN("Can't alloc tPB\n");
HeapFree( GetProcessHeap(), 0, pETEs );
return 0;
}
curPtBlock->next = tmpPtBlock;
@ -2855,6 +2856,7 @@ HRGN WINAPI CreatePolyPolygonRgn(const POINT *Pts, const INT *Count,
if(!tmpPtBlock) {
WARN("Can't alloc tPB\n");
REGION_DeleteObject( hrgn, obj );
HeapFree( GetProcessHeap(), 0, pETEs );
return 0;
}
curPtBlock->next = tmpPtBlock;

View File

@ -1788,7 +1788,11 @@ BOOL WINAPI RSAENH_CPImportKey(HCRYPTPROV hProv, CONST BYTE *pbData, DWORD dwDat
dwKeyLen = pPubKey->dwBlockLen-i-1;
*phKey = new_key(hProv, pBlobHeader->aiKeyAlg, dwKeyLen<<19, &pCryptKey);
if (*phKey == (HCRYPTKEY)INVALID_HANDLE_VALUE) return FALSE;
if (*phKey == (HCRYPTKEY)INVALID_HANDLE_VALUE)
{
HeapFree(GetProcessHeap(), 0, pbDecrypted);
return FALSE;
}
memcpy(pCryptKey->abKeyValue, pbDecrypted+i+1, dwKeyLen);
HeapFree(GetProcessHeap(), 0, pbDecrypted);
setup_key(pCryptKey);

View File

@ -2560,6 +2560,7 @@ INT WINAPI SHUnicodeToAnsiCP(UINT CodePage, LPCWSTR lpSrcStr, LPSTR lpDstStr,
{
SHTruncateString(mem, *lpiLen);
lstrcpynA(lpDstStr, mem, *lpiLen + 1);
HeapFree(GetProcessHeap(), 0, mem);
return *lpiLen + 1;
}
HeapFree(GetProcessHeap(), 0, mem);

View File

@ -444,6 +444,7 @@ HRESULT WINAPI UrlCanonicalizeW(LPCWSTR pszUrl, LPWSTR pszCanonicalized,
break;
default:
FIXME("how did we get here - state=%d\n", state);
HeapFree(GetProcessHeap(), 0, lpszUrlCpy);
return E_INVALIDARG;
}
}

View File

@ -579,6 +579,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap( const PALETTEENTRY *sys_pal_template
COLOR_sysPal = (PALETTEENTRY*)HeapAlloc(GetProcessHeap(),0,sizeof(PALETTEENTRY)*256);
if(COLOR_sysPal == NULL) {
ERR("Can not allocate system palette!\n");
HeapFree(GetProcessHeap(), 0, pixDynMapping);
return FALSE;
}
@ -589,6 +590,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap( const PALETTEENTRY *sys_pal_template
X11DRV_PALETTE_XPixelToPalette = HeapAlloc( GetProcessHeap(), 0, 256 * sizeof(int) );
if(X11DRV_PALETTE_XPixelToPalette == NULL) {
ERR("Out of memory: XPixelToPalette!\n");
HeapFree(GetProcessHeap(), 0, pixDynMapping);
return FALSE;
}
for( i = 0; i < 256; i++ )
@ -602,6 +604,7 @@ static BOOL X11DRV_PALETTE_BuildSharedMap( const PALETTEENTRY *sys_pal_template
X11DRV_PALETTE_PaletteToXPixel = (int*)HeapAlloc(GetProcessHeap(),0,sizeof(int)*256);
if(X11DRV_PALETTE_PaletteToXPixel == NULL) {
ERR("Out of memory: PaletteToXPixel!\n");
HeapFree(GetProcessHeap(), 0, pixDynMapping);
return FALSE;
}

View File

@ -894,6 +894,7 @@ BOOL X11DRV_SetWindowText( HWND hwnd, LPCWSTR text )
if (!(utf8_buffer = HeapAlloc( GetProcessHeap(), 0, count )))
{
ERR("Not enough memory for window text in UTF-8\n");
HeapFree( GetProcessHeap(), 0, buffer );
return FALSE;
}
WideCharToMultiByte(CP_UTF8, 0, text, strlenW(text), utf8_buffer, count, NULL, NULL);