From 461b1c8b7bc478c67d627373e559bd5621586a6e Mon Sep 17 00:00:00 2001 From: Hongwei Bi Date: Sat, 31 Aug 2013 11:39:35 +0800 Subject: [PATCH] Fix memory leak in cmdAttachDisk When virBufferError is ok in cmdAttachDisk, the latter should 'goto cleanup', instead of returning a false to prevent memory leaking. Signed-off-by: Eric Blake --- tools/virsh-domain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 3fd57fd2c7..568d61d001 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -661,7 +661,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) if (virBufferError(&buf)) { vshPrint(ctl, "%s", _("Failed to allocate XML buffer")); - return false; + goto cleanup; } xml = virBufferContentAndReset(&buf);