Allocate the right size and init the right krb5_context

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23934 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-10-18 21:18:03 +00:00
parent 5a7596fd02
commit eff9d3a6b4

View File

@@ -353,13 +353,13 @@ krb5_copy_context(krb5_context context, krb5_context *out)
return ENOMEM; return ENOMEM;
} }
p->mutex = malloc(sizeof(*p->mutex)); p->mutex = malloc(sizeof(HEIMDAL_MUTEX));
if (p->mutex == NULL) { if (p->mutex == NULL) {
krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", "")); krb5_set_error_message(context, ENOMEM, N_("malloc: out of memory", ""));
free(p); free(p);
return ENOMEM; return ENOMEM;
} }
HEIMDAL_MUTEX_init(context->mutex); HEIMDAL_MUTEX_init(p->mutex);
if (context->default_cc_name) if (context->default_cc_name)