Skip to content
Snippets Groups Projects
Commit 082e0bfe authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard
Browse files

Fix missing mem freeing on error path.

parent 4ff35b52
No related branches found
No related tags found
No related merge requests found
......@@ -758,8 +758,10 @@ BOOL WINAPI CryptEnumProviderTypesA (DWORD dwIndex, DWORD *pdwReserved,
keylen++;
if ( !(keyname = CRYPT_Alloc(keylen)) )
CRYPT_ReturnLastError(ERROR_NOT_ENOUGH_MEMORY);
if ( RegEnumKeyA(hKey, dwIndex, keyname, keylen) )
if ( RegEnumKeyA(hKey, dwIndex, keyname, keylen) ) {
CRYPT_Free(keyname);
return FALSE;
}
RegOpenKeyA(hKey, keyname, &hSubkey);
ch = keyname + strlen(keyname);
/* Convert "Type 000" to 0, etc/ */
......
......@@ -377,6 +377,7 @@ BOOL16 WINAPI PrintDlg16(
if (!GetPrinterDriverA(hprn, NULL, 3, (LPBYTE)dbuf, needed, &needed)) {
ERR("GetPrinterDriverA failed for %s, le %ld, fix your config!\n",
pbuf->pPrinterName,GetLastError());
HeapFree(GetProcessHeap(), 0, dbuf);
COMDLG32_SetCommDlgExtendedError(PDERR_RETDEFFAILURE);
return FALSE;
}
......
......@@ -1582,8 +1582,10 @@ LPENUMFORMATETC OLEClipbrd_IEnumFORMATETC_Construct(UINT cfmt, const FORMATETC a
ef->posFmt = 0;
ef->countFmt = cfmt;
if (FAILED(CoGetMalloc(MEMCTX_TASK, &pIMalloc)))
if (FAILED(CoGetMalloc(MEMCTX_TASK, &pIMalloc))) {
HeapFree(GetProcessHeap(), 0, ef);
return NULL;
}
ef->pFmt = (LPFORMATETC)IMalloc_Alloc(pIMalloc, size);
IMalloc_Release(pIMalloc);
......
......@@ -323,8 +323,10 @@ HRESULT WINAPI FileMonikerImpl_Load(IMoniker* iface,IStream* pStm)
filePathW=HeapAlloc(GetProcessHeap(),0,(length+1)*sizeof(WCHAR));
filePathW[length]=0;
res=IStream_Read(pStm,filePathW,doubleLenHex,&bread);
if (bread!=doubleLenHex)
if (bread!=doubleLenHex) {
HeapFree(GetProcessHeap(), 0, filePathW);
return E_FAIL;
}
if (This->filePathName!=NULL)
HeapFree(GetProcessHeap(),0,This->filePathName);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment