aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2017-12-18 09:53:08 +0100
committerDaniel P. Berrangé <berrange@redhat.com>2018-02-15 16:54:57 +0000
commit28bb0a59f84c11c42117a7009646508256ed4475 (patch)
treed29fde18717d2b7ff29347c54b1394b7edd29236
parent8c5e7bddc22dac9d4dc3526996babce4c7242d9d (diff)
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>
-rw-r--r--io/net-listener.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io/net-listener.c b/io/net-listener.c
index 77a4e2831c..de38dfae99 100644
--- a/io/net-listener.c
+++ b/io/net-listener.c
@@ -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);