Hello, some more missing free's on the error path found by smatch License: LGPL, X11 Changelog: Michael Stefaniuc <mstefani@redhat.com> - fix missing mem freeing on error path bye michael -- Michael Stefaniuc Tel.: +49-711-96437-199 System Administration Fax.: +49-711-96437-111 Red Hat GmbH Email: mstefani@redhat.com Hauptstaetterstr. 58 http://www.redhat.de/ D-70178 Stuttgart
Index: dlls/ole32/clipboard.c =================================================================== RCS file: /home/wine/wine/dlls/ole32/clipboard.c,v retrieving revision 1.28 diff -u -r1.28 clipboard.c --- dlls/ole32/clipboard.c 11 Sep 2003 03:06:25 -0000 1.28 +++ dlls/ole32/clipboard.c 30 Sep 2003 21:53:23 -0000 @@ -1582,8 +1582,10 @@ 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); Index: dlls/ole32/filemoniker.c =================================================================== RCS file: /home/wine/wine/dlls/ole32/filemoniker.c,v retrieving revision 1.26 diff -u -r1.26 filemoniker.c --- dlls/ole32/filemoniker.c 30 Sep 2003 00:24:08 -0000 1.26 +++ dlls/ole32/filemoniker.c 30 Sep 2003 21:53:24 -0000 @@ -323,8 +323,10 @@ 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); Index: dlls/commdlg/printdlg16.c =================================================================== RCS file: /home/wine/wine/dlls/commdlg/printdlg16.c,v retrieving revision 1.3 diff -u -r1.3 printdlg16.c --- dlls/commdlg/printdlg16.c 10 Sep 2003 03:56:48 -0000 1.3 +++ dlls/commdlg/printdlg16.c 30 Sep 2003 21:53:24 -0000 @@ -377,6 +377,7 @@ 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; } Index: dlls/advapi32/crypt.c =================================================================== RCS file: /home/wine/wine/dlls/advapi32/crypt.c,v retrieving revision 1.26 diff -u -r1.26 crypt.c --- dlls/advapi32/crypt.c 22 Sep 2003 19:37:55 -0000 1.26 +++ dlls/advapi32/crypt.c 30 Sep 2003 21:53:25 -0000 @@ -758,8 +758,10 @@ 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/ */
Attachment:
pgp00191.pgp
Description: PGP signature