提交 724d5340 编写于 作者: M Martin Kletzander

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: NMartin Kletzander <mkletzan@redhat.com>
上级 8fcb81d2
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册