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

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

 



On 10/12/2017 02:07 PM, Peter Krempa wrote:
> Use VIR_STEAL_PTR to remove conditional cleanup.
> ---
>  src/conf/domain_conf.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Eric Blake <eblake@xxxxxxxxxx>

> 
> 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;
> 

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
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