diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 63e235dd52..ed54a93338 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1131,7 +1131,7 @@ int qemuDomainCCWAddressAssign(virDomainDeviceInfoPtr dev, goto cleanup; } } else if (autoassign && !dev->addr.ccw.assigned) { - if (!(addr = qemuCCWAddressAsString(&addrs->next)) < 0) + if (!(addr = qemuCCWAddressAsString(&addrs->next))) goto cleanup; while (virHashLookup(addrs->defined, addr)) { @@ -1141,7 +1141,8 @@ int qemuDomainCCWAddressAssign(virDomainDeviceInfoPtr dev, goto cleanup; } VIR_FREE(addr); - addr = qemuCCWAddressAsString(&addrs->next); + if (!(addr = qemuCCWAddressAsString(&addrs->next))) + goto cleanup; } dev->addr.ccw = addrs->next; dev->addr.ccw.assigned = true;