]> xenbits.xensource.com Git - libvirt.git/commitdiff
conf: domain: Simplify return from backing store parser
authorPeter Krempa <pkrempa@redhat.com>
Fri, 6 Oct 2017 10:50:30 +0000 (12:50 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 17 Oct 2017 04:19:18 +0000 (06:19 +0200)
Use VIR_STEAL_PTR to remove conditional cleanup.

src/conf/domain_conf.c

index 0f306b7e15610cab15682bfb18620f0bbff41b64..eb3055024d57574501cf579ea8be9790223e539a 100644 (file)
@@ -8327,12 +8327,11 @@ virDomainDiskBackingStoreParse(xmlXPathContextPtr ctxt,
         virDomainDiskBackingStoreParse(ctxt, backingStore, flags) < 0)
         goto cleanup;
 
-    src->backingStore = backingStore;
+    VIR_STEAL_PTR(src->backingStore, backingStore);
     ret = 0;
 
  cleanup:
-    if (ret < 0)
-        virStorageSourceFree(backingStore);
+    virStorageSourceFree(backingStore);
     VIR_FREE(type);
     VIR_FREE(format);
     ctxt->node = save_ctxt;