From 93b8c6b1195ce0b003f1e36d61c5e7508fbd79e1 Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Mon, 16 Dec 2019 07:36:32 -0500 Subject: [PATCH] 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 Reviewed-by: Michal Privoznik --- src/vbox/vbox_snapshot_conf.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vbox/vbox_snapshot_conf.c b/src/vbox/vbox_snapshot_conf.c index 5a0abd6d0e..db6c389a64 100644 --- a/src/vbox/vbox_snapshot_conf.c +++ b/src/vbox/vbox_snapshot_conf.c @@ -352,6 +352,7 @@ virVBoxSnapshotConfCreateHardDiskNode(virVBoxSnapshotConfHardDiskPtr hardDisk) if (result < 0) { xmlUnlinkNode(ret); xmlFreeNode(ret); + ret = NULL; } VIR_FREE(uuid); return ret;