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:
Wen Congyang 2011-04-06 14:21:00 +08:00
parent f6447e8a54
commit d5981f1caf

View File

@ -1180,7 +1180,7 @@ pciWaitForDeviceCleanup(pciDevice *dev, const char *matcher)
static char *
pciReadDeviceID(pciDevice *dev, const char *id_name)
{
char *path;
char *path = NULL;
char *id_str;
if (pciDeviceFile(&path, dev->name, id_name) < 0) {