[libvirt] [PATCH 1/9] virDomainObjListAddLocked: Drop useless @cleanup label

Michal Privoznik mprivozn at redhat.com
Thu May 30 09:33:56 UTC 2019


It's a premature optimization. It's perfectly acceptable for
'error' label to deal with @vm == NULL case.

Signed-off-by: Michal Privoznik <mprivozn at 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




More information about the libvir-list mailing list