mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
Avoid virsh leaks due to missing virDomainFree(dom) calls
* src/virsh.c (cmdDomuuid): Add missing virDomainFree call. (cmdAttachDevice): Likewise. (cmdDetachDevice): Likewise.
This commit is contained in:
parent
a1d2d2b21c
commit
f5f530f33f
@ -1,5 +1,10 @@
|
||||
Wed Jan 30 20:49:34 CET 2008 Jim Meyering <meyering@redhat.com>
|
||||
|
||||
Avoid virsh leaks due to missing virDomainFree(dom) calls
|
||||
* src/virsh.c (cmdDomuuid): Add missing virDomainFree call.
|
||||
(cmdAttachDevice): Likewise.
|
||||
(cmdDetachDevice): Likewise.
|
||||
|
||||
* src/virsh.c (cmdCapabilities): Plug a small leak.
|
||||
|
||||
* src/test.c (testLoadDomain): Avoid leaks upon failure.
|
||||
|
@ -2161,6 +2161,7 @@ cmdDomuuid(vshControl * ctl, vshCmd * cmd)
|
||||
else
|
||||
vshError(ctl, FALSE, "%s", _("failed to get domain UUID"));
|
||||
|
||||
virDomainFree(dom);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -3038,8 +3039,10 @@ cmdAttachDevice(vshControl * ctl, vshCmd * cmd)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (virFileReadAll(from, VIRSH_MAX_XML_FILE, &buffer) < 0)
|
||||
if (virFileReadAll(from, VIRSH_MAX_XML_FILE, &buffer) < 0) {
|
||||
virDomainFree(dom);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ret = virDomainAttachDevice(dom, buffer);
|
||||
free (buffer);
|
||||
@ -3092,8 +3095,10 @@ cmdDetachDevice(vshControl * ctl, vshCmd * cmd)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (virFileReadAll(from, VIRSH_MAX_XML_FILE, &buffer) < 0)
|
||||
if (virFileReadAll(from, VIRSH_MAX_XML_FILE, &buffer) < 0) {
|
||||
virDomainFree(dom);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
ret = virDomainDetachDevice(dom, buffer);
|
||||
free (buffer);
|
||||
|
Loading…
x
Reference in New Issue
Block a user