summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server
diff options
context:
space:
mode:
authorHarpreet Kaur <hlalwani@redhat.com>2018-12-10 16:14:54 +0530
committerAmar Tumballi <amarts@redhat.com>2018-12-11 06:35:27 +0000
commitf50251daeece85d6ada79b1d1f6697d4fac59ad4 (patch)
tree849e59befa438094e45e09e1c3e83f43af22cbc4 /xlators/nfs/server
parent8b3a1b19fbd73545cb86029ee34033d87190bca5 (diff)
nfs: memory leak issue reported by asan
This patch fixes Direct leaks in exports.c Leaks are happening in exp_file_parse SUMMARY: AddressSanitizer: 5120 byte(s) leaked in 20 allocation(s). SUMMARY: AddressSanitizer: 512 byte(s) leaked in 4 allocation(s). Updates: bz#1633930 Change-Id: Ib4474f8f6c65d737ed54ed35b4234410d1fd673e Signed-off-by: Harpreet Kaur <hlalwani@redhat.com>
Diffstat (limited to 'xlators/nfs/server')
-rw-r--r--xlators/nfs/server/src/exports.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/exports.c b/xlators/nfs/server/src/exports.c
index 26d3d92..c62e2d9 100644
--- a/xlators/nfs/server/src/exports.c
+++ b/xlators/nfs/server/src/exports.c
@@ -203,7 +203,9 @@ _export_dir_deinit(struct export_dir *dir)
GF_VALIDATE_OR_GOTO(GF_EXP, dir, out);
GF_FREE(dir->dir_name);
_exp_dict_destroy(dir->netgroups);
+ dict_unref(dir->netgroups);
_exp_dict_destroy(dir->hosts);
+ dict_unref(dir->hosts);
GF_FREE(dir);
out:
@@ -1469,6 +1471,7 @@ exp_file_parse(const char *filepath, struct exports_file **expfile,
free_and_done:
exp_file_deinit(file);
+ _export_dir_deinit(expdir);
parse_done:
if (fp)