From 212ff5d964b70176784d503167aceefab0b3eba4 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 20 May 2015 10:58:17 -0600 Subject: [PATCH] In our krb5_get_init_creds_opt_alloc() replacement use malloc() instead of sudo_emalloc() and return KRB5_CC_NOMEM on allocation failure. Only old versions of Kerberos V will need this. --- plugins/sudoers/auth/kerb5.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/sudoers/auth/kerb5.c b/plugins/sudoers/auth/kerb5.c index c91c0de68..9104d1373 100644 --- a/plugins/sudoers/auth/kerb5.c +++ b/plugins/sudoers/auth/kerb5.c @@ -82,7 +82,9 @@ static krb5_error_code krb5_get_init_creds_opt_alloc(krb5_context context, krb5_get_init_creds_opt **opts) { - *opts = sudo_emalloc(sizeof(krb5_get_init_creds_opt)); + *opts = malloc(sizeof(krb5_get_init_creds_opt)); + if (*opts == NULL) + return KRB5_CC_NOMEM; krb5_get_init_creds_opt_init(*opts); return 0; } -- 2.40.0