All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhi Li <yieli@redhat.com>
To: linux-nfs@vger.kernel.org
Cc: steved@redhat.com, Zhi Li <yieli@redhat.com>
Subject: [PATCH] [nfs/nfs-utils/libtirpc] bindresvport.c: fix a potential resource leakage
Date: Thu, 20 Oct 2022 14:33:09 +0800	[thread overview]
Message-ID: <20221020063309.3674419-1-yieli@redhat.com> (raw)

Close the FILE *fp of load_blacklist() in another
return path to avoid potential resource leakage.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2135405
Signed-off-by: Zhi Li <yieli@redhat.com>
---
 src/bindresvport.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/bindresvport.c b/src/bindresvport.c
index 5c0ddcf..efeb1cc 100644
--- a/src/bindresvport.c
+++ b/src/bindresvport.c
@@ -130,6 +130,7 @@ load_blacklist (void)
 	  if (list == NULL)
 	    {
 	      free (buf);
+	      fclose (fp);
 	      return;
 	    }
 	}
-- 
2.31.1


             reply	other threads:[~2022-10-20  6:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20  6:33 Zhi Li [this message]
2022-10-24 17:48 ` [PATCH] [nfs/nfs-utils/libtirpc] bindresvport.c: fix a potential resource leakage Steve Dickson

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=20221020063309.3674419-1-yieli@redhat.com \
    --to=yieli@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.