From 38e342ca4a2167720bea82d3cee7fca08baba666 Mon Sep 17 00:00:00 2001 From: Humble Devassy Chirammal Date: Wed, 4 Mar 2015 18:38:07 +0530 Subject: xlator: avoiding possibility of a crash if (xl->ctx) is NULL. Change-Id: I41acd9970bef04bb16cd4d8532a84a95d5fb642a BUG: 1199003 Signed-off-by: Humble Devassy Chirammal . Reviewed-on: http://review.gluster.org/9810 Tested-by: Gluster Build System Reviewed-by: Raghavendra Bhat Reviewed-by: Vijay Bellur --- libglusterfs/src/xlator.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libglusterfs/src') diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 23cf89af026..b58247e52bc 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -502,6 +502,9 @@ xlator_mem_acct_init (xlator_t *xl, int num_types) if (!xl) return -1; + if (!xl->ctx) + return -1; + if (!xl->ctx->mem_acct_enable) return 0; -- cgit