All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: [Qemu-devel] [PATCH v2 03/30] tests: fix leaks in test-io-channel-command
Date: Tue, 21 Feb 2017 18:14:24 +0400	[thread overview]
Message-ID: <20170221141451.28305-4-marcandre.lureau@redhat.com> (raw)
In-Reply-To: <20170221141451.28305-1-marcandre.lureau@redhat.com>

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

Spotted by ASAN.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: "Daniel P. Berrange" <berrange@redhat.com>
Reviewed-by: Greg Kurz <groug@kaod.org>
---
 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 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);
 }
 
-- 
2.11.0.295.gd7dffce1c.dirty

  parent reply	other threads:[~2017-02-21 14:15 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21 14:14 [Qemu-devel] [PATCH v2 00/30] Various memory leak fixes Marc-André Lureau
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 01/30] qtest: fix a memory leak Marc-André Lureau
2017-02-21 16:40   ` Philippe Mathieu-Daudé
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 02/30] tests: fix qmp response leak Marc-André Lureau
2017-02-21 14:14 ` Marc-André Lureau [this message]
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 04/30] timer: use an inline function for free Marc-André Lureau
2017-02-22 11:33   ` Paolo Bonzini
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 05/30] glib-compat: add g_test_add_data_func_full fallback Marc-André Lureau
2017-02-21 19:15   ` Eric Blake
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 06/30] tests: fix ptimer leaks Marc-André Lureau
2017-02-22 11:33   ` Paolo Bonzini
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 07/30] tests: fix endianness-test leaks Marc-André Lureau
2017-02-21 16:40   ` Philippe Mathieu-Daudé
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 08/30] tests: fix q35-test leaks Marc-André Lureau
2017-02-28 23:05   ` Eric Blake
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 09/30] tests: fix vhost-user-test leaks Marc-André Lureau
2017-02-28 23:09   ` Eric Blake
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 10/30] tests: fix ide-test leaks Marc-André Lureau
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 11/30] tests: fix hd-geo-test leaks Marc-André Lureau
2017-02-27 13:59   ` Markus Armbruster
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 12/30] tests: fix bios-tables-test leak Marc-André Lureau
2017-02-27 14:03   ` Markus Armbruster
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 13/30] tests: fix ipmi-kcs-test leak Marc-André Lureau
2017-02-21 16:41   ` Philippe Mathieu-Daudé
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 14/30] tests: fix ipmi-bt-test leak Marc-André Lureau
2017-02-21 16:42   ` Philippe Mathieu-Daudé
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 15/30] pc: pcihp: avoid adding ACPI_PCIHP_PROP_BSEL twice Marc-André Lureau
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 16/30] tests: fix eepro100-test leak Marc-André Lureau
2017-02-21 14:42   ` Stefan Weil
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 17/30] tests: fix tco-test leaks Marc-André Lureau
2017-02-28 23:10   ` Eric Blake
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 18/30] tests: fix e1000-test leak Marc-André Lureau
2017-02-21 16:42   ` Philippe Mathieu-Daudé
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 19/30] tests: fix i440fx-test leaks Marc-André Lureau
2017-02-27 14:05   ` Markus Armbruster
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 20/30] tests: fix e1000e leaks Marc-André Lureau
2017-02-27 14:12   ` Markus Armbruster
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 21/30] tests: fix virtio-scsi-test leak Marc-André Lureau
2017-02-22 11:33   ` Paolo Bonzini
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 22/30] tests: fix virtio-9p-test leaks Marc-André Lureau
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 23/30] bus: do not unref hotplug handler Marc-André Lureau
2017-02-22 11:33   ` Paolo Bonzini
2017-02-22 13:03     ` Marc-André Lureau
2017-02-22 13:04       ` Paolo Bonzini
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 24/30] usb: replace handle_destroy with unrealize Marc-André Lureau
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 25/30] usb: release the created buses Marc-André Lureau
2017-02-21 22:59   ` Gerd Hoffmann
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 26/30] tests: allows to run single test in usb-hcd-ehci-test Marc-André Lureau
2017-02-21 16:45   ` Philippe Mathieu-Daudé
2017-02-21 23:01   ` Gerd Hoffmann
2017-02-22  8:36     ` Marc-André Lureau
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 27/30] tests: fix usb-test leaks Marc-André Lureau
2017-02-21 22:59   ` Gerd Hoffmann
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 28/30] tests: add specialized device_find function Marc-André Lureau
2017-02-28 23:21   ` Eric Blake
2017-03-01  7:59     ` Marc-André Lureau
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 29/30] tests: fix virtio-blk-test leaks Marc-André Lureau
2017-02-28 23:22   ` Eric Blake
2017-02-21 14:14 ` [Qemu-devel] [PATCH v2 30/30] migration: fix id leak regression Marc-André Lureau
2017-02-21 14:19   ` Dr. David Alan Gilbert
2017-02-21 17:04     ` Philippe Mathieu-Daudé
2017-02-22  8:41       ` Marc-André Lureau
2017-02-28  9:50   ` Dr. David Alan Gilbert
2017-02-27 11:04 ` [Qemu-devel] [PATCH v2 00/30] Various memory leak fixes Marc-André Lureau
2017-02-28 23:23   ` Eric Blake

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170221141451.28305-4-marcandre.lureau@redhat.com \
    --to=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.