]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix free of unitialized data upon PCI open fail
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 16 Jul 2009 12:23:32 +0000 (13:23 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 16 Jul 2009 12:57:44 +0000 (13:57 +0100)
src/pci.c

index 3ffa0aa5e6c27523ff2e6e7989d5743aa2f410fc..4030a14c89efdd294ccc3b7f444f61117f7b2f5b 100644 (file)
--- a/src/pci.c
+++ b/src/pci.c
@@ -834,10 +834,8 @@ pciReadDeviceID(pciDevice *dev, const char *id_name)
              dev->name, id_name);
 
     /* ID string is '0xNNNN\n' ... i.e. 7 bytes */
-    if (virFileReadAll(path, 7, &id_str) < 7) {
-        VIR_FREE(id_str);
+    if (virFileReadAll(path, 7, &id_str) < 0)
         return NULL;
-    }
 
     /* Check for 0x suffix */
     if (id_str[0] != '0' || id_str[1] != 'x') {