libqtest: Plug fd and memory leaks in qtest_quit()

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>
This commit is contained in:
Markus Armbruster 2013-06-20 08:55:28 +02:00 committed by Anthony Liguori
parent 293d2a0014
commit fdd26fca3c
1 changed files with 4 additions and 0 deletions

View File

@ -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)