io: fix QIONetListener memory leak

The sources array does not escape out of qio_net_listener_wait_client, so
we have to free it.

Reported by Coverity.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
Paolo Bonzini 2017-12-18 09:53:08 +01:00 committed by Daniel P. Berrangé
parent 8c5e7bddc2
commit 28bb0a59f8

View file

@ -234,6 +234,7 @@ QIOChannelSocket *qio_net_listener_wait_client(QIONetListener *listener)
for (i = 0; i < listener->nsioc; i++) {
g_source_unref(sources[i]);
}
g_free(sources);
g_main_loop_unref(loop);
g_main_context_unref(ctxt);