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 <euler.robot@huawei.com> Signed-off-by: Alex Chen <alex.chen@huawei.com> Reviewed-by: Li Qiang <liq3ea@gmail.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20201125102403.57709-1-alex.chen@huawei.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
84eda11079
commit
43d1da7cb9
@ -111,6 +111,7 @@ fixture_tear_down(TestFixture *fixture, gconstpointer data)
|
|||||||
|
|
||||||
g_rmdir(fixture->test_dir);
|
g_rmdir(fixture->test_dir);
|
||||||
g_free(fixture->test_dir);
|
g_free(fixture->test_dir);
|
||||||
|
close(fixture->fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void qmp_assertion_message_error(const char *domain,
|
static void qmp_assertion_message_error(const char *domain,
|
||||||
|
Loading…
Reference in New Issue
Block a user