krb5 commit: Use zapfree in krb5_decrypt_tkt_part

Greg Hudson ghudson at MIT.EDU
Wed Aug 6 10:42:58 EDT 2014


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

    Use zapfree in krb5_decrypt_tkt_part
    
    ticket: 7982 (new)
    target_version: 1.12.2
    tags: pullup

 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