migration: fix leak of src file on dst

The return path channel is possibly leaked. Fix it.

Signed-off-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
Peter Xu 2017-05-19 14:43:29 +08:00 committed by Juan Quintela
parent 3a011c26bc
commit 3482655bbc

View File

@ -133,6 +133,11 @@ void migration_incoming_state_destroy(void)
{
struct MigrationIncomingState *mis = migration_incoming_get_current();
if (mis->to_src_file) {
qemu_fclose(mis->to_src_file);
mis->to_src_file = NULL;
}
qemu_event_destroy(&mis->main_thread_load_event);
}