mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 18:03:32 +00:00
vbox: Reset @ret after xmlFreeNode
In the error path, if we xmlFreeNode @ret, then the return ret; a few lines later returns something that's already been free'd and could be reused, so let's reinit it. Found by Coverity Signed-off-by: John Ferlan <jferlan@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
010571240d
commit
93b8c6b119
@ -352,6 +352,7 @@ virVBoxSnapshotConfCreateHardDiskNode(virVBoxSnapshotConfHardDiskPtr hardDisk)
|
|||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
xmlUnlinkNode(ret);
|
xmlUnlinkNode(ret);
|
||||||
xmlFreeNode(ret);
|
xmlFreeNode(ret);
|
||||||
|
ret = NULL;
|
||||||
}
|
}
|
||||||
VIR_FREE(uuid);
|
VIR_FREE(uuid);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user