Received: from eggs.gnu.org ([2001:4830:134:3::10]:59338) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhGYR-00047I-B7 for qemu-devel@nongnu.org; Tue, 06 Sep 2016 09:36:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhGYN-0008Ux-M9 for qemu-devel@nongnu.org; Tue, 06 Sep 2016 09:36:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhGYN-0008Us-G4 for qemu-devel@nongnu.org; Tue, 06 Sep 2016 09:36:43 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1D4A0B98C2 for ; Tue, 6 Sep 2016 13:36:43 +0000 (UTC) From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Tue, 6 Sep 2016 17:36:37 +0400 Message-Id: <20160906133637.32147-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH v3] tests: fix small leak in test-io-channel-command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: berrange@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= srcfifo && dstfifo must still be freed if socat is not present. Only unlink if the fifo was actually created. Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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-comm= and.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) =20 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)); =20 + unlink(TEST_FIFO); + +end: g_free(srcfifo); g_free(dstfifo); - unlink(TEST_FIFO); } =20 =20 --=20 2.10.0