Hello, this was found by the unfree-wine.pl smatch script. I know that the mem leaks in programs/regtest.c aren't realy hurting but with over 500 lines of output from unfree-wine.pl I'm happy for any line i don't have to look at. License: LGPL, X11 Changelog: Michael Stefaniuc <mstefani@redhat.com> - fix some mem leaks found by smatch in programs/* 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: programs/notepad/dialog.c =================================================================== RCS file: /home/wine/wine/programs/notepad/dialog.c,v retrieving revision 1.24 diff -u -r1.24 dialog.c --- programs/notepad/dialog.c 21 Jul 2003 20:05:33 -0000 1.24 +++ programs/notepad/dialog.c 26 Sep 2003 21:14:12 -0000 @@ -491,6 +491,7 @@ EndDoc(printer.hDC); DeleteDC(printer.hDC); + HeapFree(GetProcessHeap(), 0, pTemp); } VOID DIALOG_FilePrinterSetup(VOID) Index: programs/regapi/regapi.c =================================================================== RCS file: /home/wine/wine/programs/regapi/regapi.c,v retrieving revision 1.20 diff -u -r1.20 regapi.c --- programs/regapi/regapi.c 31 May 2002 23:40:59 -0000 1.20 +++ programs/regapi/regapi.c 26 Sep 2003 21:14:13 -0000 @@ -736,6 +736,7 @@ strncpy(lpsRes, lpsData, lLen); lpsRes[lLen-1]='\0'; } + HeapFree(GetProcessHeap(), 0, lpsData); } else { Index: programs/regtest/regtest.c =================================================================== RCS file: /home/wine/wine/programs/regtest/regtest.c,v retrieving revision 1.9 diff -u -r1.9 regtest.c --- programs/regtest/regtest.c 14 Jan 2003 23:43:41 -0000 1.9 +++ programs/regtest/regtest.c 26 Sep 2003 21:14:13 -0000 @@ -228,6 +228,8 @@ lSts = RegEnumKey(HKEY_CURRENT_USER,0,sVal,lVal); if (lSts != ERROR_MORE_DATA) xERROR(3,lSts); + + free(sVal); } /****************************************************************************** @@ -255,6 +257,9 @@ lSts = RegEnumKeyEx(HKEY_LOCAL_MACHINE,0,sVal,&lLen1,0,sClass,&lLen2,&ft); if (lSts != ERROR_MORE_DATA) xERROR(3,lSts); + + free(sVal); + free(sClass); } /****************************************************************************** @@ -288,6 +293,9 @@ lSts = RegEnumValue(HKEY_LOCAL_MACHINE,1,sVal,&lVal,0,&lType,bVal,&lLen1); if (lSts != ERROR_NO_MORE_ITEMS) xERROR(5,lSts); + + free(sVal); + free(bVal); } /****************************************************************************** @@ -448,6 +456,8 @@ &lMaxSubLen,&lMaxClassLen,&lValues,&lMaxValNameLen, &lMaxValLen,&lSecDescLen, &ft); if (lSts != ERROR_SUCCESS) xERROR(2,lSts); + + free(sClass); } /****************************************************************************** @@ -473,6 +483,8 @@ lSts = RegQueryValue(HKEY_CURRENT_USER,"",sVal,&lLen); if (lSts != ERROR_SUCCESS) xERROR(4,lSts); + + free(sVal); } /****************************************************************************** @@ -496,6 +508,8 @@ lSts = RegQueryValueEx(HKEY_LOCAL_MACHINE,"",0,&lType,sVal,&lLen); if (lSts != ERROR_SUCCESS) xERROR(3,lSts); + + free(sVal); } /******************************************************************************
Attachment:
pgp00187.pgp
Description: PGP signature