summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2014-05-22 14:31:13 +0000
committerVijay Bellur <vbellur@redhat.com>2014-05-23 05:29:32 -0700
commit8cd30687d3ffbc29838956305ea8716bb9719acb (patch)
tree204ef19ddc862d61d1ad7c6c0341f7ec0adddac5 /xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c
parentf0ccf3ac43cd6e0fe1b3dc1a429cb3ec18a25db7 (diff)
glusterd/vol_locks: Dereference ctx->dict, only if ctx != NULL
Change-Id: I7f753aff197fe08fad255fc75d7f88d2a4632de8 BUG: 1100325 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/7849 Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Sachin Pandit <spandit@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c b/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c
index 83325f75845..48e390f5692 100644
--- a/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-mgmt-handler.c
@@ -190,11 +190,11 @@ glusterd_handle_mgmt_v3_lock_fn (rpcsvc_request_t *req)
out:
- if (ret || free_ctx) {
+ if (ctx && (ret || free_ctx)) {
if (ctx->dict)
dict_unref (ctx->dict);
- if (ctx)
- GF_FREE (ctx);
+
+ GF_FREE (ctx);
}
free (lock_req.dict.dict_val);
@@ -861,11 +861,11 @@ glusterd_handle_mgmt_v3_unlock_fn (rpcsvc_request_t *req)
out:
- if (ret || free_ctx) {
+ if (ctx && (ret || free_ctx)) {
if (ctx->dict)
dict_unref (ctx->dict);
- if (ctx)
- GF_FREE (ctx);
+
+ GF_FREE (ctx);
}
free (lock_req.dict.dict_val);