nfs-utils/6020-remove-resource-leaks-from-nfs-exports.c.patch
2019-09-30 11:09:50 -04:00

33 lines
841 B
Diff

From 7906c0c91de63bc795a52f75b62389f68297c3f3 Mon Sep 17 00:00:00 2001
From: huyan <hu.huyan@huawei.com>
Date: Mon, 17 Jun 2019 11:54:45 +0800
Subject: [PATCH] backport remove resource leaks from nfs/exports.c
---
support/nfs/exports.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/support/nfs/exports.c b/support/nfs/exports.c
index c0076a8..d826ba0 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++;
--
1.8.3.1