public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
To: Peng Fan <peng.fan@nxp.com>
Cc: Mikhail Ilin <ilin.mikhail.ol@gmail.com>, u-boot@lists.denx.de
Subject: [PATCH] tools: imx8image: Fix handle leak
Date: Wed, 23 Nov 2022 13:59:49 +0300	[thread overview]
Message-ID: <20221123105949.26475-1-ilin.mikhail.ol@gmail.com> (raw)

 The handle "fd" was created in imx8image.c:249 by calling the "fopen"
 function and is lost in imx8image.c:282.
 Should close the 'fd' file descriptor before exiting the
 parse_cfg_file(image_t *param_stack, char *name) function.

Fixes: a2b96ece5be1 ("tools: add i.MX8/8X image support")
Signed-off-by: Mikhail Ilin <ilin.mikhail.ol@gmail.com>
---
 tools/imx8image.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/imx8image.c b/tools/imx8image.c
index 01e1486911..395d5c64bd 100644
--- a/tools/imx8image.c
+++ b/tools/imx8image.c
@@ -279,6 +279,7 @@ static uint32_t parse_cfg_file(image_t *param_stack, char *name)
 		}
 	}
 
+	fclose(fd);
 	return 0;
 }
 
-- 
2.17.1


             reply	other threads:[~2022-11-23 11:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 10:59 Mikhail Ilin [this message]
2022-11-25  4:01 ` [PATCH] tools: imx8image: Fix handle leak Simon Glass
2023-01-31  9:50 ` sbabic

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=20221123105949.26475-1-ilin.mikhail.ol@gmail.com \
    --to=ilin.mikhail.ol@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=u-boot@lists.denx.de \
    /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