test-qga: fix a resource leak in test_qga_guest_get_osinfo()
PATCH 1/1 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 <[email protected]>
Signed-off-by Alex Chen <[email protected]>
--- tests/test-qga.c | 1 + 1 file changed, 1 insertion(+)
tests/test-qga.c +1 -0
@@ -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,
Signature · 1 line
2.19.1
Quoted 7 lines · Alex Chen
The
fixture->fdis created infixture_setup()and, likewise, needs to be closed
infixture_tear_down().Reported-by Euler Robot <[email protected]>Signed-off-by Alex Chen <[email protected]>
Reviewed-by Marc-André Lureau <[email protected]>
---
Quoted 21 lines
tests/test-qga.c | 1 + 1 file changed, 1 insertion(+)tests/test-qga.c +1
-0@@ -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,
--
2.19.1
Signature · 1 line
Marc-André Lureau
Quoted 6 lines · Alex Chen <[email protected]> 于2020年11月25日周三 下午6:37写道:
The
fixture->fdis created infixture_setup()and, likewise, needs to be closed infixture_tear_down().Reported-by Euler Robot <[email protected]>Signed-off-by Alex Chen <[email protected]>
Reviewed-by Li Qiang <[email protected]>
Quoted 20 lines
--- tests/test-qga.c | 1 + 1 file changed, 1 insertion(+)tests/test-qga.c +1
-1@@ -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, --2.19.1