From: Roopa Prabhu <roprabhu@xxxxxxxxx> Check strdup return value and fail if error Signed-off-by: Roopa Prabhu <roprabhu@xxxxxxxxx> --- src/util/pci.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/util/pci.c b/src/util/pci.c index 2bbb90c..df4e6c8 100644 --- a/src/util/pci.c +++ b/src/util/pci.c @@ -2018,7 +2018,13 @@ pciDeviceNetName(char *device_link_sysfs_path, char **netname) /* Assume a single directory entry */ *netname = strdup(entry->d_name); - ret = 0; + if (!*netname) { + virReportOOMError(); + ret = -1; + } + else { + ret = 0; + } break; } -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list