提交 7c23c34d 编写于 作者: R Roopa Prabhu 提交者: Eric Blake

Add missing strdup return value check

Check strdup return value and fail if error
Signed-off-by: NRoopa Prabhu <roprabhu@cisco.com>
上级 d0935478
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册