yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
9ae3a8
From 5d33e5e1bedee73ef893f1ad4141e8a613e15a84 Mon Sep 17 00:00:00 2001
9ae3a8
Message-Id: <5d33e5e1bedee73ef893f1ad4141e8a613e15a84.1383564115.git.minovotn@redhat.com>
9ae3a8
In-Reply-To: <5575e0aec51f40ebec46e98ec085cda053283aba.1383564115.git.minovotn@redhat.com>
9ae3a8
References: <5575e0aec51f40ebec46e98ec085cda053283aba.1383564115.git.minovotn@redhat.com>
9ae3a8
From: Markus Armbruster <armbru@redhat.com>
9ae3a8
Date: Fri, 27 Sep 2013 13:31:17 +0200
9ae3a8
Subject: [PATCH 07/14] libqtest: Plug fd and memory leaks in qtest_quit()
9ae3a8
MIME-Version: 1.0
9ae3a8
Content-Type: text/plain; charset=UTF-8
9ae3a8
Content-Transfer-Encoding: 8bit
9ae3a8
9ae3a8
RH-Author: Markus Armbruster <armbru@redhat.com>
9ae3a8
Message-id: <1380288680-26645-8-git-send-email-armbru@redhat.com>
9ae3a8
Patchwork-id: 54561
9ae3a8
O-Subject: [PATCH 7.0 qemu-kvm 07/10] libqtest: Plug fd and memory leaks in qtest_quit()
9ae3a8
Bugzilla: 997817
9ae3a8
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
9ae3a8
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9ae3a8
RH-Acked-by: Luiz Capitulino <lcapitulino@redhat.com>
9ae3a8
9ae3a8
From: Markus Armbruster <armbru@redhat.com>
9ae3a8
9ae3a8
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
9ae3a8
Signed-off-by: Markus Armbruster <armbru@redhat.com>
9ae3a8
Reviewed-by: Andreas Färber <afaerber@suse.de>
9ae3a8
Message-id: 1371711329-9144-2-git-send-email-armbru@redhat.com
9ae3a8
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
9ae3a8
(cherry picked from commit fdd26fca3ce66863e547560fbde1a444fc5d71b7)
9ae3a8
---
9ae3a8
 tests/libqtest.c | 4 ++++
9ae3a8
 1 file changed, 4 insertions(+)
9ae3a8
9ae3a8
Signed-off-by: Michal Novotny <minovotn@redhat.com>
9ae3a8
---
9ae3a8
 tests/libqtest.c | 4 ++++
9ae3a8
 1 file changed, 4 insertions(+)
9ae3a8
9ae3a8
diff --git a/tests/libqtest.c b/tests/libqtest.c
9ae3a8
index 879ffe9..bb82069 100644
9ae3a8
--- a/tests/libqtest.c
9ae3a8
+++ b/tests/libqtest.c
9ae3a8
@@ -171,12 +171,16 @@ void qtest_quit(QTestState *s)
9ae3a8
         waitpid(pid, &status, 0);
9ae3a8
     }
9ae3a8
 
9ae3a8
+    close(s->fd);
9ae3a8
+    close(s->qmp_fd);
9ae3a8
+    g_string_free(s->rx, true);
9ae3a8
     unlink(s->pid_file);
9ae3a8
     unlink(s->socket_path);
9ae3a8
     unlink(s->qmp_socket_path);
9ae3a8
     g_free(s->pid_file);
9ae3a8
     g_free(s->socket_path);
9ae3a8
     g_free(s->qmp_socket_path);
9ae3a8
+    g_free(s);
9ae3a8
 }
9ae3a8
 
9ae3a8
 static void socket_sendf(int fd, const char *fmt, va_list ap)
9ae3a8
-- 
9ae3a8
1.7.11.7
9ae3a8