1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemu: Fix memory leak in RDMA migration code

Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
Jiri Denemark 2014-09-23 15:22:24 +02:00
parent c58e7e78ce
commit ad56f86378

View File

@ -3792,13 +3792,13 @@ static int doNativeMigrate(virQEMUDriverPtr driver,
virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s", virReportError(VIR_ERR_OPERATION_UNSUPPORTED, "%s",
_("outgoing RDMA migration is not supported " _("outgoing RDMA migration is not supported "
"with this QEMU binary")); "with this QEMU binary"));
return -1; goto cleanup;
} }
if (!vm->def->mem.hard_limit) { if (!vm->def->mem.hard_limit) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s", virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot start RDMA migration with no memory hard " _("cannot start RDMA migration with no memory hard "
"limit set")); "limit set"));
return -1; goto cleanup;
} }
} }
@ -3819,6 +3819,7 @@ static int doNativeMigrate(virQEMUDriverPtr driver,
if (spec.destType == MIGRATION_DEST_FD) if (spec.destType == MIGRATION_DEST_FD)
VIR_FORCE_CLOSE(spec.dest.fd.qemu); VIR_FORCE_CLOSE(spec.dest.fd.qemu);
cleanup:
virURIFree(uribits); virURIFree(uribits);
return ret; return ret;