Fix an error case in encrypted timestamp preauth
authorGreg Hudson <ghudson@mit.edu>
Tue, 27 Sep 2011 15:05:44 +0000 (15:05 +0000)
committerGreg Hudson <ghudson@mit.edu>
Tue, 27 Sep 2011 15:05:44 +0000 (15:05 +0000)
If krb5_encrypt_helper returns an error, it's not the caller's
responsibility to free enc_data.ciphertext, and in one case (if
krb5_c_encrypt_length returns an error) it won't have been
initialized.

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

src/lib/krb5/krb/preauth2.c

index ed411e5ddf1dbeedc675b8fe15024d7b07d600cb..9807eeafd059a97c19d050a8d54eacb5cd737be0 100644 (file)
@@ -678,10 +678,8 @@ pa_enc_timestamp(krb5_context context, krb5_kdc_req *request,
 
     krb5_free_data(context, tmp);
 
-    if (ret) {
-        free(enc_data.ciphertext.data);
+    if (ret)
         return(ret);
-    }
 
     ret = encode_krb5_enc_data(&enc_data, &tmp);