mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 09:55:18 +00:00
pci: avoid invalid free, init path to NULL
This bug was introduce by commit 57162db8, and it will cause libvirtd crashed.
This commit is contained in:
parent
f6447e8a54
commit
d5981f1caf
@ -1180,7 +1180,7 @@ pciWaitForDeviceCleanup(pciDevice *dev, const char *matcher)
|
|||||||
static char *
|
static char *
|
||||||
pciReadDeviceID(pciDevice *dev, const char *id_name)
|
pciReadDeviceID(pciDevice *dev, const char *id_name)
|
||||||
{
|
{
|
||||||
char *path;
|
char *path = NULL;
|
||||||
char *id_str;
|
char *id_str;
|
||||||
|
|
||||||
if (pciDeviceFile(&path, dev->name, id_name) < 0) {
|
if (pciDeviceFile(&path, dev->name, id_name) < 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user