Blob Blame History Raw
From 5d33e5e1bedee73ef893f1ad4141e8a613e15a84 Mon Sep 17 00:00:00 2001
Message-Id: <5d33e5e1bedee73ef893f1ad4141e8a613e15a84.1383564115.git.minovotn@redhat.com>
In-Reply-To: <5575e0aec51f40ebec46e98ec085cda053283aba.1383564115.git.minovotn@redhat.com>
References: <5575e0aec51f40ebec46e98ec085cda053283aba.1383564115.git.minovotn@redhat.com>
From: Markus Armbruster <armbru@redhat.com>
Date: Fri, 27 Sep 2013 13:31:17 +0200
Subject: [PATCH 07/14] libqtest: Plug fd and memory leaks in qtest_quit()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

RH-Author: Markus Armbruster <armbru@redhat.com>
Message-id: <1380288680-26645-8-git-send-email-armbru@redhat.com>
Patchwork-id: 54561
O-Subject: [PATCH 7.0 qemu-kvm 07/10] libqtest: Plug fd and memory leaks in qtest_quit()
Bugzilla: 997817
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>

From: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Message-id: 1371711329-9144-2-git-send-email-armbru@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit fdd26fca3ce66863e547560fbde1a444fc5d71b7)
---
 tests/libqtest.c | 4 ++++
 1 file changed, 4 insertions(+)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 tests/libqtest.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/libqtest.c b/tests/libqtest.c
index 879ffe9..bb82069 100644
--- a/tests/libqtest.c
+++ b/tests/libqtest.c
@@ -171,12 +171,16 @@ void qtest_quit(QTestState *s)
         waitpid(pid, &status, 0);
     }
 
+    close(s->fd);
+    close(s->qmp_fd);
+    g_string_free(s->rx, true);
     unlink(s->pid_file);
     unlink(s->socket_path);
     unlink(s->qmp_socket_path);
     g_free(s->pid_file);
     g_free(s->socket_path);
     g_free(s->qmp_socket_path);
+    g_free(s);
 }
 
 static void socket_sendf(int fd, const char *fmt, va_list ap)
-- 
1.7.11.7