summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--heal/src/glfs-heal.c8
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-data.c3
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c3
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-metadata.c5
4 files changed, 18 insertions, 1 deletions
diff --git a/heal/src/glfs-heal.c b/heal/src/glfs-heal.c
index f1249ec6670..c52a46bd709 100644
--- a/heal/src/glfs-heal.c
+++ b/heal/src/glfs-heal.c
@@ -206,6 +206,10 @@ glfsh_process_entries (xlator_t *xl, fd_t *fd, gf_dirent_t *entries,
(strcmp (entry->d_name, "..") == 0))
continue;
+ if (dict) {
+ dict_unref (dict);
+ dict = NULL;
+ }
uuid_clear (gfid);
GF_FREE (path);
path = NULL;
@@ -229,6 +233,10 @@ glfsh_process_entries (xlator_t *xl, fd_t *fd, gf_dirent_t *entries,
}
ret = 0;
GF_FREE (path);
+ if (dict) {
+ dict_unref (dict);
+ dict = NULL;
+ }
return ret;
}
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c
index 0a43d128634..a434b9e6ba1 100644
--- a/xlators/cluster/afr/src/afr-self-heal-data.c
+++ b/xlators/cluster/afr/src/afr-self-heal-data.c
@@ -586,6 +586,9 @@ __afr_selfheal_data_prepare (call_frame_t *frame, xlator_t *this,
ret = afr_selfheal_unlocked_discover (frame, inode, inode->gfid,
replies);
+ if (ret)
+ return ret;
+
witness = alloca0(priv->child_count * sizeof (*witness));
ret = afr_selfheal_find_direction (frame, this, replies,
AFR_DATA_TRANSACTION,
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c
index 34784fff0e6..6af9488f9a4 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -382,6 +382,9 @@ __afr_selfheal_entry_prepare (call_frame_t *frame, xlator_t *this,
ret = afr_selfheal_unlocked_discover (frame, inode, inode->gfid,
replies);
+ if (ret)
+ return ret;
+
witness = alloca0 (sizeof (*witness) * priv->child_count);
ret = afr_selfheal_find_direction (frame, this, replies,
AFR_ENTRY_TRANSACTION,
diff --git a/xlators/cluster/afr/src/afr-self-heal-metadata.c b/xlators/cluster/afr/src/afr-self-heal-metadata.c
index c09f19ac5fd..7c0d5cb08c6 100644
--- a/xlators/cluster/afr/src/afr-self-heal-metadata.c
+++ b/xlators/cluster/afr/src/afr-self-heal-metadata.c
@@ -311,8 +311,11 @@ __afr_selfheal_metadata_prepare (call_frame_t *frame, xlator_t *this, inode_t *i
ret = afr_selfheal_unlocked_discover (frame, inode, inode->gfid,
replies);
+ if (ret)
+ return ret;
+
witness = alloca0 (sizeof (*witness) * priv->child_count);
- ret = afr_selfheal_find_direction (frame, this, replies,
+ ret = afr_selfheal_find_direction (frame, this, replies,
AFR_METADATA_TRANSACTION,
locked_on, sources, sinks, witness);
if (ret)