]> granicus.if.org Git - sudo/commitdiff
In our krb5_get_init_creds_opt_alloc() replacement use malloc()
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 20 May 2015 16:58:17 +0000 (10:58 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 20 May 2015 16:58:17 +0000 (10:58 -0600)
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

index c91c0de681772870e4ebaee61624ed8ccde28729..9104d1373ba5895abdf26935090f7a536e557e73 100644 (file)
@@ -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;
 }