[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH v2] qga/commands-posix: Fix resource leak

From: Stefan Weil
Subject: Re: [Qemu-trivial] [PATCH v2] qga/commands-posix: Fix resource leak
Date: Sat, 14 Mar 2015 10:56:09 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.5.0

Am 14.03.2015 um 10:52 schrieb Shannon Zhao:
It's detected by coverity. Close the dirfd.

Signed-off-by: Shannon Zhao <address@hidden>
Signed-off-by: Shannon Zhao <address@hidden>
     v1->v2: close after use [Stefan Weil]
  qga/commands-posix.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index d5bb5cb..ba8de62 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -2283,6 +2283,7 @@ GuestMemoryBlockInfo 
*qmp_guest_get_memory_block_info(Error **errp)
buf = g_malloc0(20);
      ga_read_sysfs_file(dirfd, "block_size_bytes", buf, 20, &local_err);
+    close(dirfd);
      if (local_err) {
          error_propagate(errp, local_err);


Reviewed-by: Stefan Weil <address@hidden>

reply via email to

[Prev in Thread] Current Thread [Next in Thread]