[libvirt] [PATCH 2/3] qemu: simplify list cleanup
Eric Blake
eblake at redhat.com
Wed Aug 28 15:55:09 UTC 2013
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 at redhat.com>
> ---
> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20130828/b4c1dd63/attachment-0001.sig>
More information about the libvir-list
mailing list