From: Peter Krempa Date: Fri, 6 Oct 2017 10:50:30 +0000 (+0200) Subject: conf: domain: Simplify return from backing store parser X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8b13c37f0b05dda2a8d87b90f46778b85e0d5498;p=libvirt.git conf: domain: Simplify return from backing store parser Use VIR_STEAL_PTR to remove conditional cleanup. --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 0f306b7e15..eb3055024d 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -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;