diff mbox series

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

Message ID 20190508133536.6077-3-steved@redhat.com (mailing list archive)
State New, archived
Headers show
Series Covertity Scan: Removed resources leaks | expand

Commit Message

Steve Dickson May 8, 2019, 1:35 p.m. UTC
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@redhat.com>
---
 support/nfs/exports.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

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++;