qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] test-qga: fix a resource leak in test_qga_guest_get_osinfo()
@ 2020-11-25 10:24 Alex Chen
  2020-11-25 10:40 ` Marc-André Lureau
  2020-11-26 10:37 ` Li Qiang
  0 siblings, 2 replies; 3+ messages in thread
From: Alex Chen @ 2020-11-25 10:24 UTC (permalink / raw)
  To: mdroth; +Cc: alex.chen, qemu-trivial, qemu-devel, zhang.zhanghailiang

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>
---
 tests/test-qga.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/test-qga.c b/tests/test-qga.c
index c1b173b3cb..eb33264e8e 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,
-- 
2.19.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-26 10:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-25 10:24 [PATCH] test-qga: fix a resource leak in test_qga_guest_get_osinfo() Alex Chen
2020-11-25 10:40 ` Marc-André Lureau
2020-11-26 10:37 ` Li Qiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).