virtio-serial-bus: Delete timer from list before free it

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Amit Shah <amit@kernel.org>
This commit is contained in:
zhanghailiang 2017-03-06 11:29:31 +08:00 committed by Michael S. Tsirkin
parent 27ce0f3afc
commit bdf4c4ec53

View File

@ -724,6 +724,7 @@ static void virtio_serial_post_load_timer_cb(void *opaque)
} }
} }
g_free(s->post_load->connected); g_free(s->post_load->connected);
timer_del(s->post_load->timer);
timer_free(s->post_load->timer); timer_free(s->post_load->timer);
g_free(s->post_load); g_free(s->post_load);
s->post_load = NULL; s->post_load = NULL;