summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorRaghavendra Talur <rtalur@redhat.com>2014-02-18 12:22:59 +0530
committerVijay Bellur <vbellur@redhat.com>2014-02-20 22:23:30 -0800
commit3a5914e421d10bca363f020b748e8648a4819495 (patch)
tree9c0a336d709f54d1eefac5f113b9890e3b56df4b /xlators/mgmt/glusterd/src
parent47e6c202fea13458f62e397ab894f740fdced5c8 (diff)
glusterd: Check for ctx before dereferencing it.
Fix for coverity CID: 1175010 & 1175011 Change-Id: Ib894fadf94c36704166ac0e2a3b6febf9b3fe446 BUG: 789278 Signed-off-by: Raghavendra Talur <rtalur@redhat.com> Reviewed-on: http://review.gluster.org/7025 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-handler.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c
index 891c1a9..12f3705 100644
--- a/xlators/mgmt/glusterd/src/glusterd-handler.c
+++ b/xlators/mgmt/glusterd/src/glusterd-handler.c
@@ -898,10 +898,11 @@ glusterd_handle_volume_lock_fn (rpcsvc_request_t *req)
out:
if (ret) {
- if (ctx->dict)
- dict_destroy (ctx->dict);
- if (ctx)
+ if (ctx) {
+ if (ctx->dict)
+ dict_destroy (ctx->dict);
GF_FREE (ctx);
+ }
}
glusterd_friend_sm ();
@@ -982,10 +983,11 @@ glusterd_handle_volume_unlock_fn (rpcsvc_request_t *req)
out:
if (ret) {
- if (ctx->dict)
- dict_destroy (ctx->dict);
- if (ctx)
+ if (ctx) {
+ if (ctx->dict)
+ dict_destroy (ctx->dict);
GF_FREE (ctx);
+ }
}
glusterd_friend_sm ();