krb5 commit [krb5-1.11]: Use zapfree in krb5_decrypt_tkt_part

Tom Yu tlyu at mit.edu
Fri Feb 6 18:44:49 EST 2015


https://github.com/krb5/krb5/commit/ff799658538ba5b980456439d7630af4a9788807
commit ff799658538ba5b980456439d7630af4a9788807
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Aug 6 16:06:54 2014 +0200

    Use zapfree in krb5_decrypt_tkt_part
    
    (cherry picked from commit 18333f731b8cb3b4610b1d623caef9347c785f7b)
    
    ticket: 8119 (new)
    version_fixed: 1.11.6
    status: resolved

 src/lib/krb5/krb/decrypt_tk.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/src/lib/krb5/krb/decrypt_tk.c b/src/lib/krb5/krb/decrypt_tk.c
index db75c0f..51f9e8f 100644
--- a/src/lib/krb5/krb/decrypt_tk.c
+++ b/src/lib/krb5/krb/decrypt_tk.c
@@ -60,14 +60,11 @@ krb5_decrypt_tkt_part(krb5_context context, const krb5_keyblock *srv_key, regist
         return retval;
     }
 
-#define clean_scratch() {memset(scratch.data, 0, scratch.length);       \
-        free(scratch.data);}
-
     /*  now decode the decrypted stuff */
     retval = decode_krb5_enc_tkt_part(&scratch, &dec_tkt_part);
     if (!retval) {
         ticket->enc_part2 = dec_tkt_part;
     }
-    clean_scratch();
+    zapfree(scratch.data, scratch.length);
     return retval;
 }


More information about the cvs-krb5 mailing list