forked from Mirrors/wine-wine
msi: Fix memory leaks (found by Smatch).
parent
066ccd1275
commit
63c5e152a1
|
@ -2268,7 +2268,10 @@ static UINT msi_dialog_list_box( msi_dialog *dialog, MSIRECORD *rec )
|
||||||
|
|
||||||
control = msi_dialog_add_control( dialog, rec, WC_LISTBOXW, style );
|
control = msi_dialog_add_control( dialog, rec, WC_LISTBOXW, style );
|
||||||
if (!control)
|
if (!control)
|
||||||
|
{
|
||||||
|
msi_free(info);
|
||||||
return ERROR_FUNCTION_FAILED;
|
return ERROR_FUNCTION_FAILED;
|
||||||
|
}
|
||||||
|
|
||||||
control->handler = msi_dialog_listbox_handler;
|
control->handler = msi_dialog_listbox_handler;
|
||||||
|
|
||||||
|
|
|
@ -605,7 +605,10 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou
|
||||||
|
|
||||||
entry->path = msi_alloc(val_size);
|
entry->path = msi_alloc(val_size);
|
||||||
if (!entry->path)
|
if (!entry->path)
|
||||||
|
{
|
||||||
|
msi_free(entry);
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
lstrcpyW(entry->szIndex, name);
|
lstrcpyW(entry->szIndex, name);
|
||||||
entry->index = atoiW(name);
|
entry->index = atoiW(name);
|
||||||
|
@ -614,7 +617,11 @@ static UINT fill_source_list(struct list *sourcelist, HKEY sourcekey, DWORD *cou
|
||||||
r = RegEnumValueW(sourcekey, index, name, &size, NULL,
|
r = RegEnumValueW(sourcekey, index, name, &size, NULL,
|
||||||
NULL, (LPBYTE)entry->path, &val_size);
|
NULL, (LPBYTE)entry->path, &val_size);
|
||||||
if (r != ERROR_SUCCESS)
|
if (r != ERROR_SUCCESS)
|
||||||
|
{
|
||||||
|
msi_free(entry->path);
|
||||||
|
msi_free(entry);
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
index = ++(*count);
|
index = ++(*count);
|
||||||
add_source_to_list(sourcelist, entry);
|
add_source_to_list(sourcelist, entry);
|
||||||
|
|
Loading…
Reference in New Issue