path: root/xlators/nfs/server
diff options
authorNiels de Vos <>2015-03-11 23:00:09 -0400
committerVijay Bellur <>2015-03-15 07:08:21 -0700
commit2c3b6ab03262108f95d706b9ebaa207b352fc32c (patch)
tree4a831a0fbfee17e7b7b4855baa2d007cb05170b3 /xlators/nfs/server
parentaa66b8404f45712c45d75d6a2a37f32e2792cc83 (diff)
nfs: use free() for getline() allocated string in netgroups
'line' is allocated through getline() which uses malloc(). GF_FREE() will fail to release the memory because it can not find the expected mem-pool header. Instead of GF_FREE(), free() should be used for strings that get allocated with getline(). Subsequent calls to getline() with a non-NULL pointer will get the size of the allocation adjusted with realloc(). Change-Id: I612fbf17d7283174d541da6f34d26e4f44e83bfa BUG: 1143880 Signed-off-by: Niels de Vos <> Reviewed-on: Tested-by: Gluster Build System <> Reviewed-by: Kaleb KEITHLEY <> Reviewed-by: Vijay Bellur <>
Diffstat (limited to 'xlators/nfs/server')
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/netgroups.c b/xlators/nfs/server/src/netgroups.c
index c605ca2664c..f5c966948f7 100644
--- a/xlators/nfs/server/src/netgroups.c
+++ b/xlators/nfs/server/src/netgroups.c
@@ -1122,7 +1122,8 @@ ng_file_parse (const char *filepath)
- GF_FREE (line);
+ /* line got allocated through getline(), don't use GF_FREE() for it */
+ free (line);
if (fp)