[libvirt PATCH] util: fix double destroy / missing unref of GSource

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A leak of the GSource was introduced in

  commit 87a43a907f0ad4897a28ad7c216bc70f37270b93
  Author: Michal Prívozník <mprivozn@xxxxxxxxxx>
  Date:   Fri Jan 28 18:42:45 2022 +0100

    lib: Use g_clear_pointer() more

As it mistakenly replaced the g_vir_source_unref call with a second
call to g_source_destroy.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 src/util/vireventglib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/vireventglib.c b/src/util/vireventglib.c
index fc04d8f712..3cc42597fd 100644
--- a/src/util/vireventglib.c
+++ b/src/util/vireventglib.c
@@ -227,7 +227,7 @@ virEventGLibHandleUpdate(int watch,
             goto cleanup;
 
         VIR_DEBUG("Removed old handle source=%p", data->source);
-        g_source_destroy(data->source);
+        vir_g_source_unref(data->source, NULL);
         g_clear_pointer(&data->source, g_source_destroy);
         data->events = 0;
     }
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux