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

Signed-off-by: Shannon Zhao <zhaoshengl...@huawei.com>
Signed-off-by: Shannon Zhao <shannon.z...@linaro.org>
---
     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) {
          g_free(buf);
          error_propagate(errp, local_err);

Thanks.

Reviewed-by: Stefan Weil <s...@weilnetz.de>


Reply via email to