Skip to content

Commit

Permalink
Initialize variables to avoid segfault.
Browse files Browse the repository at this point in the history
If we call 'keystone_end' right after 'keystone_start'
segfault occurs.
It's clear that it's not expected user behavior,
but possible segfaults should be avoided.
  • Loading branch information
Dmitry-Eremeev committed Oct 22, 2021
1 parent 11920ea commit 44df2b9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions keystone-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ keystone_start(keystone_context_t *context)
return KSERR_INIT_FAILED;
}

context->pvt.auth_token = NULL;
context->pvt.auth_payload = NULL;
context->pvt.json_tokeniser = NULL;
return KSERR_SUCCESS;
}

Expand Down

0 comments on commit 44df2b9

Please sign in to comment.