Set pointers to NULL in delete_drive to prevent heap corruption in

load_drives.
This commit is contained in:
Michael Jung 2005-02-14 20:54:21 +00:00 committed by Alexandre Julliard
parent ecdf41ef2c
commit 4fd4bf902d

View file

@ -108,8 +108,11 @@ BOOL add_drive(char letter, char *targetpath, char *label, char *serial, uint ty
void delete_drive(struct drive *d)
{
HeapFree(GetProcessHeap(), 0, d->unixpath);
d->unixpath = NULL;
HeapFree(GetProcessHeap(), 0, d->label);
d->label = NULL;
HeapFree(GetProcessHeap(), 0, d->serial);
d->serial = NULL;
d->in_use = FALSE;
}