Allocate memory rather than using fixed length buffers.

This commit is contained in:
Mike McCormack 2005-09-08 12:42:31 +00:00 committed by Alexandre Julliard
parent 0232c5c45f
commit 5c1212261f
3 changed files with 6 additions and 9 deletions

View File

@ -1110,13 +1110,8 @@ static UINT load_feature(MSIRECORD * row, LPVOID param)
if (!MSI_RecordIsNull(row,2))
MSI_RecordGetStringW(row,2,feature->Feature_Parent,&sz);
sz = 0x100;
if (!MSI_RecordIsNull(row,3))
MSI_RecordGetStringW(row,3,feature->Title,&sz);
sz = 0x100;
if (!MSI_RecordIsNull(row,4))
MSI_RecordGetStringW(row,4,feature->Description,&sz);
feature->Title = load_dynamic_stringW( row, 3 );
feature->Description = load_dynamic_stringW( row, 4 );
if (!MSI_RecordIsNull(row,5))
feature->Display = MSI_RecordGetInteger(row,5);

View File

@ -30,8 +30,8 @@ typedef struct tagMSIFEATURE
struct list entry;
WCHAR Feature[IDENTIFIER_SIZE];
WCHAR Feature_Parent[IDENTIFIER_SIZE];
WCHAR Title[0x100];
WCHAR Description[0x100];
LPWSTR Title;
LPWSTR Description;
INT Display;
INT Level;
WCHAR Directory[IDENTIFIER_SIZE];

View File

@ -438,6 +438,8 @@ static void free_feature( MSIFEATURE *feature )
list_remove( &cl->entry );
HeapFree( GetProcessHeap(), 0, cl );
}
HeapFree( GetProcessHeap(), 0, feature->Description );
HeapFree( GetProcessHeap(), 0, feature->Title );
HeapFree( GetProcessHeap(), 0, feature );
}