From 8b13c37f0b05dda2a8d87b90f46778b85e0d5498 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 6 Oct 2017 12:50:30 +0200 Subject: [PATCH] conf: domain: Simplify return from backing store parser 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 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;