From 3a5914e421d10bca363f020b748e8648a4819495 Mon Sep 17 00:00:00 2001 From: Raghavendra Talur Date: Tue, 18 Feb 2014 12:22:59 +0530 Subject: glusterd: Check for ctx before dereferencing it. Fix for coverity CID: 1175010 & 1175011 Change-Id: Ib894fadf94c36704166ac0e2a3b6febf9b3fe446 BUG: 789278 Signed-off-by: Raghavendra Talur Reviewed-on: http://review.gluster.org/7025 Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-handler.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'xlators/mgmt/glusterd/src') diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 891c1a97d..12f3705b5 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 (); -- cgit