Commit 63afcfeb authored by Mike Hearn's avatar Mike Hearn Committed by Alexandre Julliard

Fix a memory management bug in apply_drive_changes to stop winecfg

deleting all the drive definitions in some cases.
parent b889e29e
......@@ -180,6 +180,15 @@ void load_drives()
{
drives[i].letter = 'A' + i;
drives[i].in_use = FALSE;
HeapFree(GetProcessHeap(), 0, drives[i].unixpath);
drives[i].unixpath = NULL;
HeapFree(GetProcessHeap(), 0, drives[i].label);
drives[i].label = NULL;
HeapFree(GetProcessHeap(), 0, drives[i].serial);
drives[i].serial = NULL;
}
/* work backwards through the result of GetLogicalDriveStrings */
......@@ -473,11 +482,5 @@ void apply_drive_changes()
WINE_TRACE(" CreateFile() error with file '%s'\n", filename);
}
}
/* if this drive is in use we should free it up */
if(drives[i].in_use)
{
delete_drive(&drives[i]); /* free up the string memory */
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment