From: Alex Chen Date: Wed, 25 Nov 2020 10:24:03 +0000 (+0000) Subject: test-qga: fix a resource leak in test_qga_guest_get_osinfo() X-Git-Tag: v6.0.0-rc0~196^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43d1da7cb99ea66008583f531b584235d36fd0a3;p=thirdparty%2Fqemu.git test-qga: fix a resource leak in test_qga_guest_get_osinfo() The fixture->fd is created in fixture_setup() and, likewise, needs to be closed in fixture_tear_down(). Reported-by: Euler Robot Signed-off-by: Alex Chen Reviewed-by: Li Qiang Reviewed-by: Marc-André Lureau Message-Id: <20201125102403.57709-1-alex.chen@huawei.com> Signed-off-by: Thomas Huth --- diff --git a/tests/test-qga.c b/tests/test-qga.c index c1b173b3cb2..eb33264e8ed 100644 --- a/tests/test-qga.c +++ b/tests/test-qga.c @@ -111,6 +111,7 @@ fixture_tear_down(TestFixture *fixture, gconstpointer data) g_rmdir(fixture->test_dir); g_free(fixture->test_dir); + close(fixture->fd); } static void qmp_assertion_message_error(const char *domain,