lib/gssapi/ntlm: _gss_ntlm_allocate_ctx handle calloc failure

If a memory allocation failure occurs, return an error instead of
triggering a segmentation fault.

Change-Id: I38f5e88ca2f1ba7411b05a35b925168015261eb4
This commit is contained in:
Jeffrey Altman
2019-01-01 15:05:31 -05:00
parent c1c98d3cfd
commit da6190ec03

View File

@@ -50,6 +50,10 @@ _gss_ntlm_allocate_ctx(OM_uint32 *minor_status, ntlm_ctx *ctx)
return GSS_S_FAILURE;
*ctx = calloc(1, sizeof(**ctx));
if (*ctx == NULL) {
*minor_status = ENOMEM;
return GSS_S_FAILURE;
}
(*ctx)->server = ns_interface;