mirror of https://gitee.com/openkylin/libvirt.git
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:
parent
902d62f0d4
commit
461b1c8b7b
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue