statedump: fix clang null dereference error

ctx->active can be null, and is checked elsewhere in the
same function. In another case, where 'ctx->active' gets
dereferenced, it needs to be validated before the loop
is hit.

Updates: bz#1622665
Change-Id: I4ec917e96c0756586fc7a74c76848bb9589a0293
Signed-off-by: Amar Tumballi <amarts@redhat.com>
This commit is contained in:
Amar Tumballi 2018-10-25 19:48:37 +05:30
parent ace454cf40
commit bf5bfa5f2f

View File

@ -808,7 +808,7 @@ gf_proc_dump_info(int signum, glusterfs_ctx_t *ctx)
if (!ctx)
goto out;
if (ctx) {
if (ctx && ctx->active) {
top = ctx->active->first;
for (trav_p = &top->children; *trav_p; trav_p = &(*trav_p)->next) {
brick_count++;