qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrange" <berrange@redhat.com>
To: "Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 03/28] tests: fix leaks in test-io-channel-command
Date: Tue, 7 Feb 2017 14:02:37 +0000	[thread overview]
Message-ID: <20170207140237.GK2635@redhat.com> (raw)
In-Reply-To: <20170207135211.15870-4-marcandre.lureau@redhat.com>

On Tue, Feb 07, 2017 at 05:51:46PM +0400, Marc-André Lureau wrote:
> No need for strdup, fix leaks when socat is missing.
> 
> Spotted by ASAN.
> 
> Cc: "Daniel P. Berrange" <berrange@redhat.com>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  tests/test-io-channel-command.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)

ACK, I've added this to my queue, but if this merges via a
pull request for your entire series, that's fine too.

> 
> 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);
>  }


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

  reply	other threads:[~2017-02-07 14:02 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 13:51 [Qemu-devel] [PATCH 00/28] Various memory leak fixes Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 01/28] qtest: fix a memory leak Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 02/28] tests: fix qmp response leak Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 03/28] tests: fix leaks in test-io-channel-command Marc-André Lureau
2017-02-07 14:02   ` Daniel P. Berrange [this message]
2017-02-07 15:02   ` Greg Kurz
2017-02-07 13:51 ` [Qemu-devel] [PATCH 04/28] timer: use an inline function for free Marc-André Lureau
2017-02-07 16:35   ` Greg Kurz
2017-02-07 13:51 ` [Qemu-devel] [PATCH 05/28] tests: fix ptimer leaks Marc-André Lureau
2017-02-07 14:38   ` Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 06/28] tests: fix endianness-test leaks Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 07/28] tests: fix q35-test leaks Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 08/28] tests: fix vhost-user-test leaks Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 09/28] tests: fix ide-test leaks Marc-André Lureau
2017-02-08 18:16   ` John Snow
2017-02-07 13:51 ` [Qemu-devel] [PATCH 10/28] tests: fix hd-geo-test leaks Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 11/28] tests: fix bios-tables-test leak Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 12/28] tests: fix ipmi-kcs-test leak Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 13/28] tests: fix ipmi-bt-test leak Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 14/28] pc: pcihp: avoid adding ACPI_PCIHP_PROP_BSEL twice Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 15/28] tests: fix eepro100-test leak Marc-André Lureau
2017-02-07 13:51 ` [Qemu-devel] [PATCH 16/28] tests: fix tco-test leaks Marc-André Lureau
2017-02-07 13:52 ` [Qemu-devel] [PATCH 17/28] tests: fix e1000-test leak Marc-André Lureau
2017-02-07 13:52 ` [Qemu-devel] [PATCH 18/28] tests: fix i440fx-test leaks Marc-André Lureau
2017-02-07 13:52 ` [Qemu-devel] [PATCH 19/28] tests: fix e1000e leaks Marc-André Lureau
2017-02-07 13:52 ` [Qemu-devel] [PATCH 20/28] tests: fix virtio-scsi-test leak Marc-André Lureau
2017-02-07 16:43   ` Greg Kurz
2017-02-07 13:52 ` [Qemu-devel] [PATCH 21/28] tests: fix virtio-9p-test leaks Marc-André Lureau
2017-02-07 16:43   ` Greg Kurz
2017-02-07 13:52 ` [Qemu-devel] [PATCH 22/28] bus: do not unref hotplug handler Marc-André Lureau
2017-02-07 13:52 ` [Qemu-devel] [PATCH 23/28] usb: replace handle_destroy with unrealize Marc-André Lureau
2017-02-07 13:52 ` [Qemu-devel] [PATCH 24/28] usb: release the created buses Marc-André Lureau
2017-02-07 13:52 ` [Qemu-devel] [PATCH 25/28] tests: allows to run single test in usb-hcd-ehci-test Marc-André Lureau
2017-02-07 13:52 ` [Qemu-devel] [PATCH 26/28] tests: fix usb-test leaks Marc-André Lureau
2017-02-07 13:52 ` [Qemu-devel] [PATCH 27/28] tests: add specialized device_find function Marc-André Lureau
2017-02-07 13:52 ` [Qemu-devel] [PATCH 28/28] tests: fix virtio-blk-test leaks Marc-André Lureau
2017-02-07 14:50 ` [Qemu-devel] [PATCH 00/28] Various memory leak fixes no-reply

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=20170207140237.GK2635@redhat.com \
    --to=berrange@redhat.com \
    --cc=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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).