Commit f1b4c331 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

winecfg: Fixed use-after-free (Coverity).

parent c8d61899
......@@ -287,7 +287,6 @@ static void ensure_drive_c_is_mapped(void)
len = snprintf(NULL, 0, "%s/../drive_c", configdir);
drive_c_dir = HeapAlloc(GetProcessHeap(), 0, len);
snprintf(drive_c_dir, len, "%s/../drive_c", configdir);
HeapFree(GetProcessHeap(), 0, drive_c_dir);
if (stat(drive_c_dir, &buf) == 0)
{
......@@ -300,6 +299,7 @@ static void ensure_drive_c_is_mapped(void)
{
report_error(NO_DRIVE_C);
}
HeapFree(GetProcessHeap(), 0, drive_c_dir);
}
int autodetect_drives(void)
......
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