interface: Need to check ifacedef->mac not just ifacedef after strdup()

This commit is contained in:
John Ferlan 2013-01-15 13:35:36 -05:00 committed by Peter Krempa
parent 761fc48136
commit 3f9d6c3566

View File

@ -577,7 +577,7 @@ udevIfaceGetIfaceDef(struct udev *udev, char *name)
/* MAC address */ /* MAC address */
ifacedef->mac = strdup(udev_device_get_sysattr_value(dev, "address")); ifacedef->mac = strdup(udev_device_get_sysattr_value(dev, "address"));
if (!ifacedef) { if (!ifacedef->mac) {
virReportOOMError(); virReportOOMError();
goto cleanup; goto cleanup;
} }