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>
This commit is contained in:
Raghavendra Talur 2014-02-18 12:22:59 +05:30 committed by Vijay Bellur
parent 47e6c202fe
commit 3a5914e421

View File

@ -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 ();