[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: zhanghailiang
Subject: Re: [Qemu-trivial] [PATCH v2] qga/commands-posix: Fix resource leak
Date: Mon, 16 Mar 2015 09:27:09 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.1

On 2015/3/14 17:52, Shannon Zhao wrote:
It's detected by coverity. Close the dirfd.

Reviewed-by: zhanghailiang <address@hidden>

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);

reply via email to

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