]> xenbits.xensource.com Git - libvirt.git/commitdiff
pci: avoid invalid free, init path to NULL
authorWen Congyang <wency@cn.fujitsu.com>
Wed, 6 Apr 2011 06:21:00 +0000 (14:21 +0800)
committerWen Congyang <wency@cn.fujitsu.com>
Thu, 7 Apr 2011 05:09:39 +0000 (13:09 +0800)
This bug was introduce by commit 57162db8, and it will cause libvirtd crashed.

src/util/pci.c

index 6ed96f4fd27efe5ca70f005f865f208a96ae3d37..a7b8caaa3bb2ba987eea8874c37e37ab7db8af4c 100644 (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) {