From 7981e0a3657d2573dde10fb9cca194ceabd23d4a Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Fri, 3 Sep 2010 02:43:21 +0000 Subject: [PATCH] clean up memory leak and potential unused variable in crypto tests t_prf.c: Ensure prfsz is set before use (not exercised in current tests) t_short.c: Fix memory leak ticket: 6769 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24287 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/crypto_tests/t_prf.c | 3 +++ src/lib/crypto/crypto_tests/t_short.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/lib/crypto/crypto_tests/t_prf.c b/src/lib/crypto/crypto_tests/t_prf.c index 6336d8651..d9ac3d8b9 100644 --- a/src/lib/crypto/crypto_tests/t_prf.c +++ b/src/lib/crypto/crypto_tests/t_prf.c @@ -75,7 +75,10 @@ int main () { free (input.data); input.data = NULL; + } else { + prfsz = 0; } + for (; prfsz > 0; prfsz--) { printf ("%02x", (unsigned int) ((unsigned char ) output.data[output.length-prfsz])); diff --git a/src/lib/crypto/crypto_tests/t_short.c b/src/lib/crypto/crypto_tests/t_short.c index 9ddfd5e3d..90f15b8a8 100644 --- a/src/lib/crypto/crypto_tests/t_short.c +++ b/src/lib/crypto/crypto_tests/t_short.c @@ -109,6 +109,8 @@ test_enctype(krb5_enctype enctype) free(input.ciphertext.data); free(output.data); } + krb5int_c_free_keyblock_contents (NULL, &keyblock); + } int -- 2.26.2