else
tokenSize = 2 + data->length;
- token->value = q = k5alloc(tokenSize, &code);
- if (code != 0)
+ token->value = q = gssalloc_malloc(tokenSize);
+ if (q == NULL) {
+ code = ENOMEM;
goto cleanup;
+ }
token->length = tokenSize;
if (initialContextToken) {
}
if ((output_name_buffer->value =
- malloc(union_name->external_name->length + 1)) == NULL) {
+ gssalloc_malloc(union_name->external_name->length + 1)) == NULL) {
if (output_name_type && *output_name_type != GSS_C_NULL_OID) {
(void) generic_gss_release_oid(minor_status,
output_name_type);
mechOidTagLen + mechOidDERLen +
mech_type->length +
nameLenLen + dispName.length;
- if ((name_buf->value = (void*)malloc(name_buf->length)) ==
+ if ((name_buf->value = (void*)gssalloc_malloc(name_buf->length)) ==
(void*)NULL) {
name_buf->length = 0;
(void) gss_release_buffer(&status, &dispName);
tlen += 1 + gssint_der_length_size(hintNameSize);
negHintsSize = tlen;
- t = (unsigned char *)malloc(tlen);
+ t = gssalloc_malloc(tlen);
if (t == NULL) {
*minor_status = ENOMEM;
goto errout;
return (NULL);
input_token->length = len;
- input_token->value = malloc(input_token->length);
+ input_token->value = gssalloc_malloc(input_token->length);
if (input_token->value == NULL) {
free(input_token);
* 0x30 [DER LEN]
*/
tlen = 1 + gssint_der_length_size(ilen) + ilen;
- ptr = malloc(tlen);
+ ptr = gssalloc_malloc(tlen);
if (ptr == NULL)
return -1;
return GSS_S_FAILURE;
tmpbuf.length = ptr - (unsigned char *)tmpbuf.value;
- der_mechSet->value = malloc(tmpbuf.length);
+ der_mechSet->value = gssalloc_malloc(tmpbuf.length);
if (der_mechSet->value == NULL)
return GSS_S_FAILURE;
memcpy(der_mechSet->value, tmpbuf.value, tmpbuf.length);
tlen = g_token_size(gss_mech_spnego, negTokenInitSize);
- t = (unsigned char *) malloc(tlen);
+ t = (unsigned char *) gssalloc_malloc(tlen);
if (t == NULL) {
return (-1);
dataLen += 1 + gssint_der_length_size(NegTokenSize);
tlen = dataLen;
- t = (unsigned char *) malloc(tlen);
+ t = (unsigned char *) gssalloc_malloc(tlen);
if (t == NULL) {
ret = GSS_S_DEFECTIVE_TOKEN;