提交 93b8c6b1 编写于 作者: J John Ferlan

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: NJohn Ferlan <jferlan@redhat.com>
Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
上级 01057124
...@@ -352,6 +352,7 @@ virVBoxSnapshotConfCreateHardDiskNode(virVBoxSnapshotConfHardDiskPtr hardDisk) ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册