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:
John Ferlan 2019-12-16 07:36:32 -05:00
parent 010571240d
commit 93b8c6b119

View File

@ -352,6 +352,7 @@ virVBoxSnapshotConfCreateHardDiskNode(virVBoxSnapshotConfHardDiskPtr hardDisk)
if (result < 0) {
xmlUnlinkNode(ret);
xmlFreeNode(ret);
ret = NULL;
}
VIR_FREE(uuid);
return ret;