Skip to contentSkip to conversation

bindresvport.c: fix a potential resource leakage

PATCH In review Zhi Li 2 participants 2 messages Oct 20, 2022 – Oct 24, 2022

Subsystems (2)
lore
Share & tools
lore

Zhi Li

author
#0 lore raw

PATCH 1/1 bindresvport.c: fix a potential resource leakage

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

---
 src/bindresvport.c | 1 +
 1 file changed, 1 insertion(+)
src/bindresvport.c +1 -0
index 5c0ddcf..efeb1cc 100644
@@ -130,6 +130,7 @@ load_blacklist (void)
 	  if (list == NULL)
 	    {
 	      free (buf);
+	      fclose (fp);
 	      return;
 	    }
 	}
Signature · 1 line
2.31.1
#1 lore raw
Quoted 13 lines · Zhi Li

Subject:
[PATCH] [nfs/nfs-utils/libtirpc] bindresvport.c: fix a potential resource leakage From:
Zhi Li <[email protected]>
Date:
10/20/22, 2:33 AM

To:
[email protected]
CC:
[email protected], Zhi Li <[email protected]>

Quoted 5 lines

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

Committed...

steved.

Quoted 18 lines
---
  src/bindresvport.c | 1 +
  1 file changed, 1 insertion(+)
src/bindresvport.c +1 -1
index 5c0ddcf..efeb1cc 100644
@@ -130,6 +130,7 @@ load_blacklist (void)
  	  if (list == NULL)
  	    {
  	      free (buf);
+	      fclose (fp);
  	      return;
  	    }
  	}
-- 2.31.1