[Spice-devel] [spice-gtk v1 5/6] spice-gstaudio: fix GTask leak on query for volume

Victor Toso victortoso at redhat.com
Mon Sep 2 16:04:48 UTC 2019


From: Victor Toso <me at victortoso.com>

 > 184 bytes in 1 blocks are definitely lost in loss record 12,668 of 14,231
 >    at 0x483880B: malloc (vg_replace_malloc.c:309)
 >    by 0x4A64C98: g_malloc (in /usr/lib64/libglib-2.0.so.0.6000.6)
 >    by 0x4A7CFB5: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.6000.6)
 >    by 0x4A7D5DD: g_slice_alloc0 (in /usr/lib64/libglib-2.0.so.0.6000.6)
 >    by 0x4D3E061: g_type_create_instance (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 >    by 0x4D2042C: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 >    by 0x4D21B14: g_object_new_with_properties (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 >    by 0x4D226C0: g_object_new (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 >    by 0x4BE0FB8: g_task_new (in /usr/lib64/libgio-2.0.so.0.6000.6)
 >    by 0x48EDFCB: spice_gstaudio_get_record_volume_info_async (spice-gstaudio.c:679)
 >    by 0x48C2A4F: spice_audio_get_record_volume_info_async (spice-audio.c:212)
 >    by 0x48B2F00: agent_sync_audio_record (channel-main.c:1285)
 >
 > 240 (184 direct, 56 indirect) bytes in 1 blocks are definitely lost in loss record 12,889 of 14,231
 >    at 0x483880B: malloc (vg_replace_malloc.c:309)
 >    by 0x4A64C98: g_malloc (in /usr/lib64/libglib-2.0.so.0.6000.6)
 >    by 0x4A7CFB5: g_slice_alloc (in /usr/lib64/libglib-2.0.so.0.6000.6)
 >    by 0x4A7D5DD: g_slice_alloc0 (in /usr/lib64/libglib-2.0.so.0.6000.6)
 >    by 0x4D3E061: g_type_create_instance (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 >    by 0x4D2042C: ??? (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 >    by 0x4D21B14: g_object_new_with_properties (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 >    by 0x4D226C0: g_object_new (in /usr/lib64/libgobject-2.0.so.0.6000.6)
 >    by 0x4BE0FB8: g_task_new (in /usr/lib64/libgio-2.0.so.0.6000.6)
 >    by 0x48EDAF9: spice_gstaudio_get_playback_volume_info_async (spice-gstaudio.c:597)
 >    by 0x48C2967: spice_audio_get_playback_volume_info_async (spice-audio.c:189)
 >    by 0x48B2C33: agent_sync_audio_playback (channel-main.c:1229)

Signed-off-by: Victor Toso <victortoso at redhat.com>
---
 src/spice-gstaudio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/spice-gstaudio.c b/src/spice-gstaudio.c
index 9be647b..9e9fd49 100644
--- a/src/spice-gstaudio.c
+++ b/src/spice-gstaudio.c
@@ -597,6 +597,7 @@ static void spice_gstaudio_get_playback_volume_info_async(SpiceAudio *audio,
     GTask *task = g_task_new(audio, cancellable, callback, user_data);
 
     g_task_return_boolean(task, TRUE);
+    g_object_unref(task);
 }
 
 static gboolean spice_gstaudio_get_playback_volume_info_finish(SpiceAudio *audio,
@@ -679,6 +680,7 @@ static void spice_gstaudio_get_record_volume_info_async(SpiceAudio *audio,
     GTask *task = g_task_new(audio, cancellable, callback, user_data);
 
     g_task_return_boolean(task, TRUE);
+    g_object_unref(task);
 }
 
 static gboolean spice_gstaudio_get_record_volume_info_finish(SpiceAudio *audio,
-- 
2.21.0



More information about the Spice-devel mailing list