[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL v2 2/3] tests: fix leaks in test-io-channel-command
From: |
Daniel P. Berrange |
Subject: |
[Qemu-devel] [PULL v2 2/3] tests: fix leaks in test-io-channel-command |
Date: |
Thu, 2 Mar 2017 16:10:32 +0000 |
From: Marc-André Lureau <address@hidden>
No need for strdup, fix leaks when socat is missing.
Spotted by ASAN.
Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Daniel P. Berrange <address@hidden>
---
tests/test-io-channel-command.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/tests/test-io-channel-command.c b/tests/test-io-channel-command.c
index 1d1f461..46ce1ff 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);
}
--
2.9.3
- [Qemu-devel] [PULL v2 0/3] Merge qio 2017/02/27, Daniel P. Berrange, 2017/03/02
- [Qemu-devel] [PULL v2 1/3] io: fix decoding when multiple websockets frames arrive at once, Daniel P. Berrange, 2017/03/02
- [Qemu-devel] [PULL v2 2/3] tests: fix leaks in test-io-channel-command,
Daniel P. Berrange <=
- [Qemu-devel] [PULL v2 3/3] io: fully parse & validate HTTP headers for websocket protocol handshake, Daniel P. Berrange, 2017/03/02
- Re: [Qemu-devel] [PULL v2 0/3] Merge qio 2017/02/27, no-reply, 2017/03/02
- Re: [Qemu-devel] [PULL v2 0/3] Merge qio 2017/02/27, Christian Borntraeger, 2017/03/03
- Re: [Qemu-devel] [PULL v2 0/3] Merge qio 2017/02/27, Fam Zheng, 2017/03/03
- Re: [Qemu-devel] [PULL v2 0/3] Merge qio 2017/02/27, Christian Borntraeger, 2017/03/03
- Re: [Qemu-devel] [PULL v2 0/3] Merge qio 2017/02/27, Fam Zheng, 2017/03/03
- Re: [Qemu-devel] [PULL v2 0/3] Merge qio 2017/02/27, Christian Borntraeger, 2017/03/03
- Re: [Qemu-devel] [PULL v2 0/3] Merge qio 2017/02/27, Fam Zheng, 2017/03/03
- Re: [Qemu-devel] [PULL v2 0/3] Merge qio 2017/02/27, Peter Maydell, 2017/03/03