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:
@@ -50,6 +50,10 @@ _gss_ntlm_allocate_ctx(OM_uint32 *minor_status, ntlm_ctx *ctx)
|
|||||||
return GSS_S_FAILURE;
|
return GSS_S_FAILURE;
|
||||||
|
|
||||||
*ctx = calloc(1, sizeof(**ctx));
|
*ctx = calloc(1, sizeof(**ctx));
|
||||||
|
if (*ctx == NULL) {
|
||||||
|
*minor_status = ENOMEM;
|
||||||
|
return GSS_S_FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
(*ctx)->server = ns_interface;
|
(*ctx)->server = ns_interface;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user