From 34111a60f894b86f416434f0ec39c37999af4998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Thu, 3 Mar 2016 17:31:47 +0100 Subject: [PATCH] tools: do not leak uri in disconnect handler 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 72446be37e..57b4ff3475 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 3c818a3a29..c47053639d 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);