summaryrefslogtreecommitdiffstats
path: root/xlators/features/trash/src/trash.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/trash/src/trash.c')
-rw-r--r--xlators/features/trash/src/trash.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c
index e8f8b7bf051..8a92685cf4b 100644
--- a/xlators/features/trash/src/trash.c
+++ b/xlators/features/trash/src/trash.c
@@ -2616,16 +2616,24 @@ fini (xlator_t *this)
GF_VALIDATE_OR_GOTO ("trash", this, out);
priv = this->private;
- inode_table = priv->trash_itable;
if (priv) {
- if (priv->newtrash_dir)
+ inode_table = priv->trash_itable;
+ if (priv->newtrash_dir) {
GF_FREE (priv->newtrash_dir);
- if (priv->oldtrash_dir)
+ priv->newtrash_dir = NULL;
+ }
+ if (priv->oldtrash_dir) {
GF_FREE (priv->oldtrash_dir);
- if (priv->brick_path)
+ priv->oldtrash_dir = NULL;
+ }
+ if (priv->brick_path) {
GF_FREE (priv->brick_path);
- if (priv->eliminate)
+ priv->brick_path = NULL;
+ }
+ if (priv->eliminate) {
wipe_eliminate_path (&priv->eliminate);
+ priv->eliminate = NULL;
+ }
if (inode_table) {
inode_table_destroy (inode_table);
priv->trash_itable = NULL;