diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2016-07-27 12:50:41 +0200 |
---|---|---|
committer | Fabiano FidĂȘncio <fidencio@redhat.com> | 2016-07-29 14:30:07 +0200 |
commit | cbf9da900caa2ac9be55eabd9f20ed4f23c7cee2 (patch) | |
tree | c606d309a5258aa8b42116505b8cdd60f2bd0f20 | |
parent | 9f91b03bc4c3c58e77169dfe71a8ec7525be5118 (diff) |
vmc: Fix leak in spice_vmc_output_stream_write_finish()
We own a reference on the GAsyncResult returned by
g_task_propage_pointer() so we have to g_object_unref() it when we no
longer need it.
Acked-by: Fabiano FidĂȘncio <fidencio@redhat.com>
-rw-r--r-- | src/vmcstream.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/vmcstream.c b/src/vmcstream.c index ffb1ba4..09a296b 100644 --- a/src/vmcstream.c +++ b/src/vmcstream.c @@ -399,9 +399,13 @@ spice_vmc_output_stream_write_finish(GOutputStream *stream, { SpiceVmcOutputStream *self = SPICE_VMC_OUTPUT_STREAM(stream); GAsyncResult *res = g_task_propagate_pointer(G_TASK(simple), error); + gssize bytes_written; SPICE_DEBUG("spicevmc write finish"); - return spice_vmc_write_finish(self->channel, res, error); + bytes_written = spice_vmc_write_finish(self->channel, res, error); + g_object_unref(res); + + return bytes_written; } static void |