In krb5_encrypt_helper, return ENOMEM instead of 0 if we can't
authorGreg Hudson <ghudson@mit.edu>
Tue, 6 Oct 2009 16:36:34 +0000 (16:36 +0000)
committerGreg Hudson <ghudson@mit.edu>
Tue, 6 Oct 2009 16:36:34 +0000 (16:36 +0000)
allocate the ciphertext buffer.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22860 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/enc_helper.c

index 63e3495da5ca79e7d449e4830d41e6b9bf6e184d..34aa612d6c7af28bedc957bd86d979b34713d4c1 100644 (file)
@@ -38,7 +38,7 @@ krb5_encrypt_helper(krb5_context context, const krb5_keyblock *key, krb5_keyusag
 
     cipher->ciphertext.length = enclen;
     if ((cipher->ciphertext.data = (char *) malloc(enclen)) == NULL)
-       return(ret);
+       return(ENOMEM);
     ret = krb5_c_encrypt(context, key, usage, 0, plain, cipher);
     if (ret) {
        free(cipher->ciphertext.data);