提交 9b4bc795 编写于 作者: S Stefan Berger 提交者: Eric Blake

tests: Call virCommandFree() in cleanup section

Fix a potential memory leak by calling virCommandFree() in the cleanup
section.
Signed-off-by: NStefan Berger <stefanb@linux.ibm.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
Message-Id: <20190726205633.2041912-3-stefanb@linux.vnet.ibm.com>
上级 b8358f94
...@@ -1219,8 +1219,6 @@ static int test27(const void *unused ATTRIBUTE_UNUSED) ...@@ -1219,8 +1219,6 @@ static int test27(const void *unused ATTRIBUTE_UNUSED)
goto cleanup; goto cleanup;
} }
virCommandFree(cmd);
if (!outactual || !erractual) if (!outactual || !erractual)
goto cleanup; goto cleanup;
...@@ -1236,6 +1234,7 @@ static int test27(const void *unused ATTRIBUTE_UNUSED) ...@@ -1236,6 +1234,7 @@ static int test27(const void *unused ATTRIBUTE_UNUSED)
ret = 0; ret = 0;
cleanup: cleanup:
virCommandFree(cmd);
VIR_FORCE_CLOSE(pipe1[0]); VIR_FORCE_CLOSE(pipe1[0]);
VIR_FORCE_CLOSE(pipe2[0]); VIR_FORCE_CLOSE(pipe2[0]);
VIR_FORCE_CLOSE(pipe1[1]); VIR_FORCE_CLOSE(pipe1[1]);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册