Add missing strdup return value check

Check strdup return value and fail if error

Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
This commit is contained in:
Roopa Prabhu 2011-10-14 15:25:28 -07:00 committed by Eric Blake
parent d09354786a
commit 7c23c34d38

View File

@ -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;
}