mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
Don't free an uninitalized pointer in update_driver_name()
This invalid free results in heap corruption. Some symptoms I saw because of this were libvirtd crashing and virt-manager hanging while trying to enumerate devices.
This commit is contained in:
parent
7679f064bf
commit
338e7c3c8d
@ -78,7 +78,7 @@ static int update_driver_name(virConnectPtr conn,
|
||||
virNodeDeviceObjPtr dev)
|
||||
{
|
||||
char *driver_link = NULL;
|
||||
char *devpath;
|
||||
char *devpath = NULL;
|
||||
char *p;
|
||||
int ret = -1;
|
||||
|
||||
@ -114,7 +114,7 @@ static int update_driver_name(virConnectPtr conn,
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(driver_link);
|
||||
free(devpath);
|
||||
VIR_FREE(devpath);
|
||||
return ret;
|
||||
}
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user