gssapi: import mechglue allocation utility functions from Heimdal-520

Apple's Heimdal impelmentation uses a number of utility functions for
allocating names and credentials, to avoid calling malloc or calloc directly.
Import them.
This commit is contained in:
Luke Howard
2019-01-03 10:17:26 +11:00
committed by Nico Williams
parent e0bb9c10ca
commit 83f15553e0
22 changed files with 163 additions and 86 deletions

View File

@@ -50,11 +50,11 @@ gss_set_cred_option (OM_uint32 *minor_status,
if (cred == NULL) {
struct _gss_mech_switch *m;
cred = malloc(sizeof(*cred));
if (cred == NULL)
cred = _gss_mg_alloc_cred();
if (cred == NULL) {
*minor_status = ENOMEM;
return GSS_S_FAILURE;
HEIM_SLIST_INIT(&cred->gc_mc);
}
HEIM_SLIST_FOREACH(m, &_gss_mechs, gm_link) {