提交 14324f58 编写于 作者: M Marc-André Lureau

tests: fix leaks in test-io-channel-command

No need for strdup, fix leaks when socat is missing.

Spotted by ASAN.
Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: N"Daniel P. Berrange" <berrange@redhat.com>
Reviewed-by: NGreg Kurz <groug@kaod.org>
上级 dc491fea
......@@ -29,8 +29,8 @@ static void test_io_channel_command_fifo(bool async)
#define TEST_FIFO "tests/test-io-channel-command.fifo"
QIOChannel *src, *dst;
QIOChannelTest *test;
char *srcfifo = g_strdup_printf("PIPE:%s,wronly", TEST_FIFO);
char *dstfifo = g_strdup_printf("PIPE:%s,rdonly", TEST_FIFO);
const char *srcfifo = "PIPE:" TEST_FIFO ",wronly";
const char *dstfifo = "PIPE:" TEST_FIFO ",rdonly";
const char *srcargv[] = {
"/bin/socat", "-", srcfifo, NULL,
};
......@@ -59,8 +59,6 @@ static void test_io_channel_command_fifo(bool async)
object_unref(OBJECT(src));
object_unref(OBJECT(dst));
g_free(srcfifo);
g_free(dstfifo);
unlink(TEST_FIFO);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册