aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-02-07 17:51:46 +0400
committerDaniel P. Berrange <berrange@redhat.com>2017-02-28 10:36:32 +0000
commite3d90312b3748431ca7c1ecb10cd4614f32f0ae3 (patch)
tree2c127ecd93d9c304d948c63a26759492fbbdd4ef
parentcd892a2efc47bf45d058578fb557ba6db235a3a8 (diff)
tests: fix leaks in test-io-channel-command
No need for strdup, fix leaks when socat is missing. Spotted by ASAN. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
-rw-r--r--tests/test-io-channel-command.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/test-io-channel-command.c b/tests/test-io-channel-command.c
index 1d1f461bed..46ce1ff01c 100644
--- a/tests/test-io-channel-command.c
+++ b/tests/test-io-channel-command.c
@@ -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);
}