From 1611ac457fc9a89e39728a8b486a6633cda08b15 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Tue, 14 Apr 2020 12:37:56 +1000 Subject: [PATCH] krb5: allow NULL authenticator in krb5_auth_con_free() When freeing an auth context, allow the authenticator to be NULL. Useful for freeing partially allocated authentication context. --- lib/krb5/auth_context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/krb5/auth_context.c b/lib/krb5/auth_context.c index 4473a4421..43c762b76 100644 --- a/lib/krb5/auth_context.c +++ b/lib/krb5/auth_context.c @@ -86,7 +86,8 @@ krb5_auth_con_free(krb5_context context, krb5_auth_context auth_context) { if (auth_context != NULL) { - krb5_free_authenticator(context, &auth_context->authenticator); + if (auth_context->authenticator) + krb5_free_authenticator(context, &auth_context->authenticator); if(auth_context->local_address){ free_HostAddress(auth_context->local_address); free(auth_context->local_address);