summaryrefslogtreecommitdiffstats
path: root/xlators/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/nfs')
-rw-r--r--xlators/nfs/server/src/exports.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/xlators/nfs/server/src/exports.c b/xlators/nfs/server/src/exports.c
index 3f704bdf9ce..793e020dd1f 100644
--- a/xlators/nfs/server/src/exports.c
+++ b/xlators/nfs/server/src/exports.c
@@ -91,11 +91,12 @@ _exports_file_init ()
goto free_and_out;
}
-
-
goto out;
free_and_out:
+ if (file->exports_dict)
+ dict_unref (file->exports_dict);
+
GF_FREE (file);
file = NULL;
out:
@@ -141,10 +142,21 @@ out:
void
exp_file_deinit (struct exports_file *expfile)
{
- if (!expfile || !expfile->exports_dict)
+ if (!expfile)
goto out;
- dict_foreach (expfile->exports_dict, _exp_file_dict_destroy, NULL);
+ if (expfile->exports_dict) {
+ dict_foreach (expfile->exports_dict, _exp_file_dict_destroy,
+ NULL);
+ dict_unref (expfile->exports_dict);
+ }
+
+ if (expfile->exports_map) {
+ dict_foreach (expfile->exports_map, _exp_file_dict_destroy,
+ NULL);
+ dict_unref (expfile->exports_map);
+ }
+
GF_FREE (expfile->filename);
GF_FREE (expfile);
out: