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 <eblake@redhat.com>
This commit is contained in:
Hongwei Bi 2013-08-31 11:39:35 +08:00 committed by Eric Blake
parent 902d62f0d4
commit 461b1c8b7b

View File

@ -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);