On Dec 9, 2007 4:44 AM, Lionel_Debroux lionel_debroux@yahoo.fr wrote:
"msi_build_insertsql_data" and "MSI_DatabaseImport" in dlls/msi/database.c get flagged by Michael Stefaniuc's unfree-wine.pl script.
It looks there are more leaks than unfree-wine.pl reports, due to constructs of the form ptr = msi_realloc(ptr, size); Fixed those as well.
2007-12-09 Lionel Debroux lionel_debroux@yahoo.fr * dlls/msi/database.c: msi: fix memory leaks (found by Smatch).
- columns = msi_realloc(columns, sql_size * sizeof(WCHAR)); - if (!columns) + temp_columns = msi_realloc(columns, sql_size * sizeof(WCHAR)); + if (!temp_columns) + { + HeapFree( GetProcessHeap(), 0, columns); return NULL; + }
lstrcatW(columns, expanded);
This is wrong. There's no guarantee that realloc returns the same position in memory.