X-Git-Url: http://libvirt.org/git/?p=libvirt.git;a=blobdiff_plain;f=src%2Fpci.c;h=4030a14c89efdd294ccc3b7f444f61117f7b2f5b;hp=3ffa0aa5e6c27523ff2e6e7989d5743aa2f410fc;hb=4a7acedd3c59a6a750576cb8680bc3f08fe0b52c;hpb=1795bfe4a177a5eff1b3b0a16d56df6f371c0f8e diff --git a/src/pci.c b/src/pci.c index 3ffa0aa..4030a14 100644 --- 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') {