From: Ezra Peisach Date: Sat, 10 Oct 2009 11:33:01 +0000 (+0000) Subject: Fix memory leak and init those magic number fields to prevent compiler warning X-Git-Tag: krb5-1.8-alpha1~304 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b23dccd80996a74755836c3fb89fa75b2ac1ee05;p=krb5.git Fix memory leak and init those magic number fields to prevent compiler warning when structure copied. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22879 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/crypto/crypto_tests/t_encrypt.c b/src/lib/crypto/crypto_tests/t_encrypt.c index 974dc585b..739c6d3e0 100644 --- a/src/lib/crypto/crypto_tests/t_encrypt.c +++ b/src/lib/crypto/crypto_tests/t_encrypt.c @@ -83,7 +83,6 @@ main () int i; size_t len; krb5_enc_data enc_out, enc_out2; - krb5_error_code retval; krb5_keyblock *key; memset(iov, 0, sizeof(iov)); @@ -102,7 +101,9 @@ main () if (out.data == NULL || out2.data == NULL || check.data == NULL || check2.data == NULL) abort(); + out.magic = KV5M_DATA; out.length = 2048; + out2.magic = KV5M_DATA; out2.length = 2048; check.length = 2048; check2.length = 2048; @@ -128,6 +129,7 @@ main () /* We support iov/aead*/ int j, pos; krb5_data signdata; + signdata.magic = KV5M_DATA; signdata.data = (char *) "This should be signed"; signdata.length = strlen(signdata.data); iov[0].flags= KRB5_CRYPTO_TYPE_STREAM; @@ -204,6 +206,7 @@ main () krb5_c_decrypt (context, key, 9, 0, &enc_out, &check)); test ("Comparing", compare_results (&in, &check)); + krb5_free_keyblock (context, key); free(out.data); free(out2.data); free(check.data);