James Hawkins : msi: Store the number of types we queried. We were leaking these types because we didn't have the correct count.
Module: wine Branch: master Commit: 3188792a3048f20626f18d4fe3e7429149fcc277 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3188792a3048f20626f18d4fe3... Author: James Hawkins <truiken(a)gmail.com> Date: Sun Dec 13 19:35:45 2009 -0800 msi: Store the number of types we queried. We were leaking these types because we didn't have the correct count. This change also fixes weird 8-space indenting in free_merge_tables. --- dlls/msi/database.c | 50 +++++++++++++++++++++++++++----------------------- 1 files changed, 27 insertions(+), 23 deletions(-) diff --git a/dlls/msi/database.c b/dlls/msi/database.c index adbdb9d..d823dc6 100644 --- a/dlls/msi/database.c +++ b/dlls/msi/database.c @@ -1451,6 +1451,7 @@ static UINT msi_get_query_types(MSIQUERY *query, LPWSTR **types, DWORD *numtypes goto end; } + *numtypes = count; for (i=1; i<=count; i++ ) { (*types)[i-1] = strdupW(MSI_RecordGetString(prec, i)); @@ -1477,32 +1478,36 @@ static void merge_free_rows(MERGETABLE *table) static void free_merge_table(MERGETABLE *table) { - UINT i; + UINT i; - if (table->labels != NULL) - { - for (i = 0; i < table->numlabels; i++) - msi_free(table->labels[i]); - msi_free(table->labels); - } + if (table->labels != NULL) + { + for (i = 0; i < table->numlabels; i++) + msi_free(table->labels[i]); - if (table->columns != NULL) - { - for (i = 0; i < table->numcolumns; i++) - msi_free(table->columns[i]); - msi_free(table->columns); - } + msi_free(table->labels); + } - if (table->types != NULL) - { - for (i = 0; i < table->numtypes; i++) - msi_free(table->types[i]); - msi_free(table->types); - } - msi_free(table->name); - merge_free_rows(table); + if (table->columns != NULL) + { + for (i = 0; i < table->numcolumns; i++) + msi_free(table->columns[i]); - msi_free(table); + msi_free(table->columns); + } + + if (table->types != NULL) + { + for (i = 0; i < table->numtypes; i++) + msi_free(table->types[i]); + + msi_free(table->types); + } + + msi_free(table->name); + merge_free_rows(table); + + msi_free(table); } static UINT msi_get_merge_table (MSIDATABASE *db, LPCWSTR name, MERGETABLE **ptable) @@ -1753,7 +1758,6 @@ UINT WINAPI MsiDatabaseMergeW(MSIHANDLE hDatabase, MSIHANDLE hDatabaseMerge, LIST_FOR_EACH_SAFE(item, cursor, &tabledata) { MERGETABLE *table = LIST_ENTRY(item, MERGETABLE, entry); - list_remove(&table->entry); free_merge_table(table); }
participants (1)
-
Alexandre Julliard