qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Chen <alex.chen@huawei.com>
To: <mdroth@linux.vnet.ibm.com>
Cc: alex.chen@huawei.com, qemu-trivial@nongnu.org,
	qemu-devel@nongnu.org, zhang.zhanghailiang@huawei.com
Subject: [PATCH] test-qga: fix a resource leak in test_qga_guest_get_osinfo()
Date: Wed, 25 Nov 2020 10:24:03 +0000	[thread overview]
Message-ID: <20201125102403.57709-1-alex.chen@huawei.com> (raw)

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



             reply	other threads:[~2020-11-25 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-25 10:24 Alex Chen [this message]
2020-11-25 10:40 ` [PATCH] test-qga: fix a resource leak in test_qga_guest_get_osinfo() Marc-André Lureau
2020-11-26 10:37 ` Li Qiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201125102403.57709-1-alex.chen@huawei.com \
    --to=alex.chen@huawei.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=zhang.zhanghailiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).