Skip to content

Commit

Permalink
io: fix QIONetListener memory leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bonzini authored and berrange committed Feb 15, 2018
1 parent 8c5e7bd commit 28bb0a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions io/net-listener.c
Expand Up @@ -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);

Expand Down

0 comments on commit 28bb0a5

Please sign in to comment.