Ensure newly allocated ccache handles are zeroed

Otherwise, type-independent fields such as `initialized` have
uninitialized values, and incorrect behaviour may result.
This commit is contained in:
Viktor Dukhovni
2016-06-02 02:38:04 -04:00
parent abad8d5700
commit 7d9fcb46b9

View File

@@ -162,8 +162,8 @@ _krb5_cc_allocate(krb5_context context,
{
krb5_ccache p;
p = malloc (sizeof(*p));
if(p == NULL) {
p = calloc(1, sizeof(*p));
if (p == NULL) {
krb5_set_error_message(context, KRB5_CC_NOMEM,
N_("malloc: out of memory", ""));
return KRB5_CC_NOMEM;