[PATCH 1/9] conf: domain: Simplify return from backing store parser

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use VIR_STEAL_PTR to remove conditional cleanup.
---
 src/conf/domain_conf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 54be9028d..f7c9160b4 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -8315,12 +8315,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;
-- 
2.14.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux