From: Ján Tomko Date: Thu, 3 Mar 2016 16:31:47 +0000 (+0100) Subject: tools: do not leak uri in disconnect handler X-Git-Tag: v1.3.3-rc1~284 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=34111a60f894b86f416434f0ec39c37999af4998;p=thirdparty%2Flibvirt.git 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 --- 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);