Re: [PATCH 2/3] qemu: simplify list cleanup

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

 



On 08/27/2013 10:00 PM, Eric Blake wrote:
> No need to open code now that we have a nice function.
> 
> * src/qemu/qemu_command.c (qemuParseCommandLinePid): Simplify cleanup.
> 
> Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
> ---
>  src/qemu/qemu_command.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
> index bc55859..6c5f247 100644
> --- a/src/qemu/qemu_command.c
> +++ b/src/qemu/qemu_command.c
> @@ -11777,11 +11777,7 @@ virDomainDefPtr qemuParseCommandLinePid(virCapsPtr qemuCaps,
> 
>  cleanup:
>      VIR_FREE(exepath);
> -    for (i = 0; progargv && progargv[i]; i++)
> -        VIR_FREE(progargv[i]);
> -    VIR_FREE(progargv);
> -    for (i = 0; progenv && progenv[i]; i++)
> -        VIR_FREE(progenv[i]);
> -    VIR_FREE(progenv);
> +    virStringFreeList(progargv);
> +    virSTringFreeList(progenv);

Self-nack to this version of the patch - this fails to build (STring
instead of String, and even then, I got a complaint about 'char **' and
'const char **' being incomptable).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://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]