diff --git a/src/util/pci.c b/src/util/pci.c index 2bbb90c0a6e92ad5be4a7ac267d4f56a3a565dd6..33b4b0ee12cef571bfa8d3ae7f34c61fa868d668 100644 --- a/src/util/pci.c +++ b/src/util/pci.c @@ -2018,7 +2018,10 @@ pciDeviceNetName(char *device_link_sysfs_path, char **netname) /* Assume a single directory entry */ *netname = strdup(entry->d_name); - ret = 0; + if (!*netname) + virReportOOMError(); + else + ret = 0; break; }