diff options
author | Humble Devassy Chirammal <hchiramm@redhat.com> | 2015-03-04 18:38:07 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-03-15 20:01:23 -0700 |
commit | 38e342ca4a2167720bea82d3cee7fca08baba666 (patch) | |
tree | c90b3343c3ebd40a03ad1f83d30af12d7352dd1d | |
parent | aaf7cd3c4059167b0f2ba821d14362a977f1d58c (diff) |
xlator: avoiding possibility of a crash if (xl->ctx) is NULL.
Change-Id: I41acd9970bef04bb16cd4d8532a84a95d5fb642a
BUG: 1199003
Signed-off-by: Humble Devassy Chirammal <hchiramm@redhat.com>.
Reviewed-on: http://review.gluster.org/9810
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
-rw-r--r-- | libglusterfs/src/xlator.c | 3 |
1 files changed, 3 insertions, 0 deletions
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; |