From: Todd C. Miller Date: Wed, 20 May 2015 16:58:17 +0000 (-0600) Subject: In our krb5_get_init_creds_opt_alloc() replacement use malloc() X-Git-Tag: SUDO_1_8_14^2~115 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=212ff5d964b70176784d503167aceefab0b3eba4;p=sudo 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. --- 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; }