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

@@ -73,12 +73,11 @@ gss_inquire_cred(OM_uint32 *minor_status,
*mechanisms = GSS_C_NO_OID_SET;
if (name_ret) {
name = calloc(1, sizeof(*name));
name = _gss_create_name(NULL, NULL);
if (name == NULL) {
*minor_status = ENOMEM;
return (GSS_S_FAILURE);
}
HEIM_SLIST_INIT(&name->gn_mn);
} else {
name = NULL;
}