mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
tests: Call virCommandFree() in cleanup section
Fix a potential memory leak by calling virCommandFree() in the cleanup section. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: John Ferlan <jferlan@redhat.com> Message-Id: <20190726205633.2041912-3-stefanb@linux.vnet.ibm.com>
This commit is contained in:
parent
b8358f94e0
commit
9b4bc79549
@ -1219,8 +1219,6 @@ static int test27(const void *unused ATTRIBUTE_UNUSED)
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
virCommandFree(cmd);
|
||||
|
||||
if (!outactual || !erractual)
|
||||
goto cleanup;
|
||||
|
||||
@ -1236,6 +1234,7 @@ static int test27(const void *unused ATTRIBUTE_UNUSED)
|
||||
ret = 0;
|
||||
|
||||
cleanup:
|
||||
virCommandFree(cmd);
|
||||
VIR_FORCE_CLOSE(pipe1[0]);
|
||||
VIR_FORCE_CLOSE(pipe2[0]);
|
||||
VIR_FORCE_CLOSE(pipe1[1]);
|
||||
|
Loading…
Reference in New Issue
Block a user