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
This commit is contained in:
Ján Tomko 2016-03-03 17:31:47 +01:00
parent bde6e002b5
commit 34111a60f8
2 changed files with 2 additions and 0 deletions

View File

@ -124,6 +124,7 @@ virshCatchDisconnect(virConnectPtr conn,
break;
}
vshError(ctl, _(str), NULLSTR(uri));
VIR_FREE(uri);
if (error) {
virSetError(error);

View File

@ -92,6 +92,7 @@ vshAdmCatchDisconnect(virAdmConnectPtr conn ATTRIBUTE_UNUSED,
}
vshError(ctl, _(str), NULLSTR(uri));
VIR_FREE(uri);
if (error) {
virSetError(error);