diff options
author | Raghavendra Talur <rtalur@redhat.com> | 2014-02-18 12:22:59 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2014-02-20 22:23:30 -0800 |
commit | 3a5914e421d10bca363f020b748e8648a4819495 (patch) | |
tree | 9c0a336d709f54d1eefac5f113b9890e3b56df4b | |
parent | 47e6c202fea13458f62e397ab894f740fdced5c8 (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>
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 14 |
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 891c1a97da5..12f3705b5e7 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 (); |