All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v3] tests: fix small leak in test-io-channel-command
@ 2016-09-06 13:36 Marc-André Lureau
  2016-09-06 13:44 ` Daniel P. Berrange
  0 siblings, 1 reply; 3+ messages in thread
From: Marc-André Lureau @ 2016-09-06 13:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: berrange, Marc-André Lureau

srcfifo && dstfifo must still be freed if socat is not present.

Only unlink if the fifo was actually created.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 tests/test-io-channel-command.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/test-io-channel-command.c b/tests/test-io-channel-command.c
index 1d1f461..4fc1732 100644
--- a/tests/test-io-channel-command.c
+++ b/tests/test-io-channel-command.c
@@ -40,7 +40,7 @@ static void test_io_channel_command_fifo(bool async)
 
     unlink(TEST_FIFO);
     if (access("/bin/socat", X_OK) < 0) {
-        return; /* Pretend success if socat is not present */
+        goto end; /* Pretend success if socat is not present */
     }
     if (mkfifo(TEST_FIFO, 0600) < 0) {
         abort();
@@ -59,9 +59,11 @@ static void test_io_channel_command_fifo(bool async)
     object_unref(OBJECT(src));
     object_unref(OBJECT(dst));
 
+    unlink(TEST_FIFO);
+
+end:
     g_free(srcfifo);
     g_free(dstfifo);
-    unlink(TEST_FIFO);
 }
 
 
-- 
2.10.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH v3] tests: fix small leak in test-io-channel-command
  2016-09-06 13:36 [Qemu-devel] [PATCH v3] tests: fix small leak in test-io-channel-command Marc-André Lureau
@ 2016-09-06 13:44 ` Daniel P. Berrange
  2016-09-06 13:47   ` Marc-André Lureau
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel P. Berrange @ 2016-09-06 13:44 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: qemu-devel

On Tue, Sep 06, 2016 at 05:36:37PM +0400, Marc-André Lureau wrote:
> srcfifo && dstfifo must still be freed if socat is not present.
> 
> Only unlink if the fifo was actually created.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  tests/test-io-channel-command.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>

I'll add this to my I/O queue unless you respin your current PULL request
with this included.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH v3] tests: fix small leak in test-io-channel-command
  2016-09-06 13:44 ` Daniel P. Berrange
@ 2016-09-06 13:47   ` Marc-André Lureau
  0 siblings, 0 replies; 3+ messages in thread
From: Marc-André Lureau @ 2016-09-06 13:47 UTC (permalink / raw)
  To: Daniel P. Berrange, peter.maydell; +Cc: Marc-André Lureau, qemu-devel

Hi

----- Original Message -----
> On Tue, Sep 06, 2016 at 05:36:37PM +0400, Marc-André Lureau wrote:
> > srcfifo && dstfifo must still be freed if socat is not present.
> > 
> > Only unlink if the fifo was actually created.
> > 
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >  tests/test-io-channel-command.c | 6 ++++--
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> 
> I'll add this to my I/O queue unless you respin your current PULL request
> with this included.

I don't know what's best. Peter, should I send a new pull request with the new patch? Or send a new one without it? Or you can pull the current request without this patch?

thanks

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-06 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06 13:36 [Qemu-devel] [PATCH v3] tests: fix small leak in test-io-channel-command Marc-André Lureau
2016-09-06 13:44 ` Daniel P. Berrange
2016-09-06 13:47   ` Marc-André Lureau

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.