fix memory leak near NTLM type2 response
This commit is contained in:

committed by
Jeffrey Altman

parent
d64076dfd9
commit
8526b4c627
@@ -171,12 +171,14 @@ _gss_ntlm_accept_sec_context
|
|||||||
output_token->value = malloc(out.length);
|
output_token->value = malloc(out.length);
|
||||||
if (output_token->value == NULL && out.length != 0) {
|
if (output_token->value == NULL && out.length != 0) {
|
||||||
OM_uint32 gunk;
|
OM_uint32 gunk;
|
||||||
|
heim_ntlm_free_buf(&out);
|
||||||
_gss_ntlm_delete_sec_context(&gunk, context_handle, NULL);
|
_gss_ntlm_delete_sec_context(&gunk, context_handle, NULL);
|
||||||
*minor_status = ENOMEM;
|
*minor_status = ENOMEM;
|
||||||
return GSS_S_FAILURE;
|
return GSS_S_FAILURE;
|
||||||
}
|
}
|
||||||
memcpy(output_token->value, out.data, out.length);
|
memcpy(output_token->value, out.data, out.length);
|
||||||
output_token->length = out.length;
|
output_token->length = out.length;
|
||||||
|
heim_ntlm_free_buf(&out);
|
||||||
|
|
||||||
ctx->flags = retflags;
|
ctx->flags = retflags;
|
||||||
|
|
||||||
|
@@ -252,6 +252,7 @@ kdc_type2(OM_uint32 *minor_status,
|
|||||||
krb5_data ti;
|
krb5_data ti;
|
||||||
|
|
||||||
memset(&type2, 0, sizeof(type2));
|
memset(&type2, 0, sizeof(type2));
|
||||||
|
memset(out, 0, sizeof(*out));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Request data for type 2 packet from the KDC.
|
* Request data for type 2 packet from the KDC.
|
||||||
|
Reference in New Issue
Block a user