summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/cluster/ha/src/ha.c6
-rw-r--r--xlators/features/changelog/src/changelog.c23
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-syncop.c3
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c7
4 files changed, 23 insertions, 16 deletions
diff --git a/xlators/cluster/ha/src/ha.c b/xlators/cluster/ha/src/ha.c
index 3eccb516b65..742ec46f107 100644
--- a/xlators/cluster/ha/src/ha.c
+++ b/xlators/cluster/ha/src/ha.c
@@ -2694,7 +2694,12 @@ ha_statfs_cbk (call_frame_t *frame,
ha_local_t *local = NULL;
ha_private_t *priv = NULL;
+ GF_ASSERT (this);
+
local = frame->local;
+ priv = this->private;
+ GF_ASSERT (priv);
+
if (-1 == op_ret) {
local->active = (local->active + 1) % priv->child_count;
local->tries--;
@@ -2711,7 +2716,6 @@ ha_statfs_cbk (call_frame_t *frame,
out:
loc_wipe (&local->loc);
STACK_UNWIND (frame, op_ret, op_errno, buf);
-
return 0;
}
diff --git a/xlators/features/changelog/src/changelog.c b/xlators/features/changelog/src/changelog.c
index 4ed7cc7f0e9..42292352b72 100644
--- a/xlators/features/changelog/src/changelog.c
+++ b/xlators/features/changelog/src/changelog.c
@@ -2039,20 +2039,21 @@ init (xlator_t *this)
out:
if (ret) {
- if (this->local_pool)
+ if (this && this->local_pool)
mem_pool_destroy (this->local_pool);
- if (priv->cb) {
- ret = priv->cb->dtor (this, &priv->cd);
- if (ret)
- gf_log (this->name, GF_LOG_ERROR,
+ if (priv) {
+ if (priv->cb) {
+ ret = priv->cb->dtor (this, &priv->cd);
+ if (ret)
+ gf_log (this->name, GF_LOG_ERROR,
"error in cleanup during init()");
+ }
+ GF_FREE (priv->changelog_brick);
+ GF_FREE (priv->changelog_dir);
+ if (cond_lock_init)
+ changelog_pthread_destroy (priv);
+ GF_FREE (priv);
}
- GF_FREE (priv->changelog_brick);
- GF_FREE (priv->changelog_dir);
- if (cond_lock_init)
- changelog_pthread_destroy (priv);
-
- GF_FREE (priv);
this->private = NULL;
} else
this->private = priv;
diff --git a/xlators/mgmt/glusterd/src/glusterd-syncop.c b/xlators/mgmt/glusterd/src/glusterd-syncop.c
index 23824bd4ec3..1381edbab9d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-syncop.c
+++ b/xlators/mgmt/glusterd/src/glusterd-syncop.c
@@ -1362,6 +1362,8 @@ gd_unlock_op_phase (glusterd_conf_t *conf, glusterd_op_t op, int *op_ret,
struct list_head *peers = NULL;
peers = &conf->xaction_peers;
+ this = THIS;
+ GF_ASSERT (this);
if (!npeers) {
ret = 0;
@@ -1375,7 +1377,6 @@ gd_unlock_op_phase (glusterd_conf_t *conf, glusterd_op_t op, int *op_ret,
goto out;
}
- this = THIS;
synctask_barrier_init((&args));
peer_cnt = 0;
if (conf->op_version < GD_OP_VERSION_3_6_0) {
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index 8515320d894..94949e79111 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -8435,9 +8435,10 @@ glusterd_get_local_brickpaths (glusterd_volinfo_t *volinfo, char **pathlist)
ret = count;
out:
- for (i = 0; i < count; i++) {
- GF_FREE (path_tokens[i]);
- path_tokens[i] = NULL;
+ if (path_tokens) {
+ for (i = 0; i < count; i++) {
+ GF_FREE (path_tokens[i]);
+ }
}
GF_FREE (path_tokens);