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(a)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