From 724d5340bd76ef6dd28d34efc269037ff8ea1a91 Mon Sep 17 00:00:00 2001 From: Martin Kletzander Date: Tue, 1 Mar 2016 17:36:55 +0100 Subject: [PATCH] virt-admin: Don't leak uri in cmdSrvList virAdmConnectGetURI() returns string that needs to be free()'d but we haven't done that. Signed-off-by: Martin Kletzander --- tools/virt-admin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index c47053639d..60697e630d 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -323,7 +323,7 @@ cmdSrvList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) int nsrvs = 0; size_t i; bool ret = false; - const char *uri = NULL; + char *uri = NULL; virAdmServerPtr *srvs = NULL; vshAdmControlPtr priv = ctl->privData; @@ -347,6 +347,7 @@ cmdSrvList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) virAdmServerFree(srvs[i]); VIR_FREE(srvs); } + VIR_FREE(uri); return ret; } -- GitLab