summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2010-09-14 09:27:14 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-14 08:15:56 -0700
commitc55cc2d5362a607692beac96a34add2e79a9ad44 (patch)
treec1f5afd5aac488c28b729063e27c59e5c9bca8aa
parenta9cbdd2916ab6851d108833e30536c02bf502f17 (diff)
compare op_errstr before freeing
Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1598 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1598
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c6
-rw-r--r--xlators/mgmt/glusterd/src/glusterd3_1-mops.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 6ef471c49..4d5fb05e1 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -3341,7 +3341,7 @@ out:
op_errno, req, ctx, op_errstr);
if (ctx_free && ctx && (op != -1))
glusterd_op_free_ctx (op, ctx, ctx_free);
- if (op_errstr)
+ if (op_errstr && (strcmp (op_errstr, "")))
GF_FREE (op_errstr);
gf_log ("glusterd", GF_LOG_NORMAL, "Returning %d", ret);
@@ -3399,7 +3399,7 @@ glusterd_op_ac_stage_op (glusterd_op_sm_event_t *event, void *ctx)
ret = glusterd_op_stage_send_resp (stage_ctx->req, req->op, status, op_errstr);
- if (op_errstr)
+ if (op_errstr && (strcmp (op_errstr, "")))
GF_FREE (op_errstr);
gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret);
@@ -3430,7 +3430,7 @@ glusterd_op_ac_commit_op (glusterd_op_sm_event_t *event, void *ctx)
ret = glusterd_op_commit_send_resp (commit_ctx->req, req->op, status, op_errstr);
- if (op_errstr)
+ if (op_errstr && (strcmp (op_errstr, "")))
GF_FREE (op_errstr);
gf_log ("", GF_LOG_DEBUG, "Returning with %d", ret);
diff --git a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
index 9bc05ec78..f0d7931f9 100644
--- a/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
+++ b/xlators/mgmt/glusterd/src/glusterd3_1-mops.c
@@ -1324,7 +1324,7 @@ out:
if (!ret)
req->rpc_err = SUCCESS;
}
- if (op_errstr)
+ if (op_errstr && (strcmp (op_errstr, "")))
GF_FREE (op_errstr);
if (!ret)
gf_log ("", GF_LOG_WARNING, "Returning %d", ret);