From d5981f1caf33ef6c49d739544db3b6a2a716f2f5 Mon Sep 17 00:00:00 2001 From: Wen Congyang Date: Wed, 6 Apr 2011 14:21:00 +0800 Subject: [PATCH] pci: avoid invalid free, init path to NULL This bug was introduce by commit 57162db8, and it will cause libvirtd crashed. --- src/util/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/pci.c b/src/util/pci.c index 6ed96f4fd2..a7b8caaa3b 100644 --- a/src/util/pci.c +++ b/src/util/pci.c @@ -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) {