Re: [PATCH 1/3] qemu_hotplug.c: use VIR_AUTOFREE() in strings 1/3

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

 



On Wed, Sep 18, 2019 at 04:53:06PM -0300, Daniel Henrique Barboza wrote:
> Using VIR_AUTOFREE() spare us from calling VIR_VREE() and
> sometimes a whole 'cleanup' label can be erased as well.
>
> There are quite a few strings in qemu_hotplug.c to be
> auto-freed. This is the first part of this change.
>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@xxxxxxxxx>
> ---
[...]

> @@ -517,7 +507,7 @@ qemuDomainChangeMediaBlockdev(virQEMUDriverPtr driver,
>      qemuDomainDiskPrivatePtr diskPriv = QEMU_DOMAIN_DISK_PRIVATE(disk);
>      VIR_AUTOPTR(qemuBlockStorageSourceChainData) newbackend = NULL;
>      VIR_AUTOPTR(qemuBlockStorageSourceChainData) oldbackend = NULL;
> -    char *nodename = NULL;
> +    VIR_AUTOFREE(char *) nodename = NULL;
>      int rc;
>      int ret = -1;
>
> @@ -572,7 +562,6 @@ qemuDomainChangeMediaBlockdev(virQEMUDriverPtr driver,
>      ret = 0;
>
>   cleanup:

^This cleanup label can be dropped as well after the change.

Erik

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