[PATCH 02/19] Removed resource leaks from nfs/exports.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



nfs/exports.c:717: leaked_storage: Variable "id" going out
	of scope leaks the storage it points to.

nfs/exports.c:727: leaked_storage: Variable "id" going out
	of scope leaks the storage it points to.

Signed-off-by: Steve Dickson <steved@xxxxxxxxxx>
---
 support/nfs/exports.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/support/nfs/exports.c b/support/nfs/exports.c
index b59d187..5f4cb95 100644
--- a/support/nfs/exports.c
+++ b/support/nfs/exports.c
@@ -714,6 +714,7 @@ parsesquash(char *list, int **idp, int *lenp, char **ep)
 		}
 		if (id0 == -1 || id1 == -1) {
 			syntaxerr("uid/gid -1 not permitted");
+			xfree(id);
 			return -1;
 		}
 		if ((len % 8) == 0)
@@ -724,6 +725,7 @@ parsesquash(char *list, int **idp, int *lenp, char **ep)
 			break;
 		if (*cp != ',') {
 			syntaxerr("bad uid/gid list");
+			xfree(id);
 			return -1;
 		}
 		cp++;
-- 
2.20.1




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux