It's a premature optimization. It's perfectly acceptable for
'error' label to deal with @vm == NULL case.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
src/conf/virdomainobjlist.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c
index f5a7ecc4a4..d58d25f847 100644
--- a/src/conf/virdomainobjlist.c
+++ b/src/conf/virdomainobjlist.c
@@ -332,7 +332,7 @@ virDomainObjListAddLocked(virDomainObjListPtr doms,
}
if (!(vm = virDomainObjNew(xmlopt)))
- goto cleanup;
+ goto error;
vm->def = def;
if (virDomainObjListAddObjLocked(doms, vm) < 0) {
@@ -340,7 +340,7 @@ virDomainObjListAddLocked(virDomainObjListPtr doms,
goto error;
}
}
- cleanup:
+
return vm;
error:
--
2.21.0
--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list