[PATCH] tools: do not leak uri in disconnect handler

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

 



Commit 035947e introduced a call to virConnectGetURI
without a matching free() in virshCatchDisconnect.

Also fix vshAdmCatchDisconnect where it was copied by
commit 6dd7e42.

https://bugzilla.redhat.com/show_bug.cgi?id=1303891
---
 tools/virsh.c      | 1 +
 tools/virt-admin.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/virsh.c b/tools/virsh.c
index 72446be..57b4ff3 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -124,6 +124,7 @@ virshCatchDisconnect(virConnectPtr conn,
             break;
         }
         vshError(ctl, _(str), NULLSTR(uri));
+        VIR_FREE(uri);
 
         if (error) {
             virSetError(error);
diff --git a/tools/virt-admin.c b/tools/virt-admin.c
index 3c818a3..c470536 100644
--- a/tools/virt-admin.c
+++ b/tools/virt-admin.c
@@ -92,6 +92,7 @@ vshAdmCatchDisconnect(virAdmConnectPtr conn ATTRIBUTE_UNUSED,
     }
 
     vshError(ctl, _(str), NULLSTR(uri));
+    VIR_FREE(uri);
 
     if (error) {
         virSetError(error);
-- 
2.4.10

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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]