diff options
author | Ezra Peisach <epeisach@mit.edu> | 2003-05-12 09:29:46 +0000 |
---|---|---|
committer | Ezra Peisach <epeisach@mit.edu> | 2003-05-12 09:29:46 +0000 |
commit | dac851d4a5f25c7924d5bdd48900f3b56f5db275 (patch) | |
tree | bd2f7202b59fd165a58231acf4e0ec9c4dd723e8 /src/tests/asn.1/ktest.h | |
parent | b7d2f686d8c563ab64636974d64b5fae92ad1766 (diff) | |
download | krb5-dac851d4a5f25c7924d5bdd48900f3b56f5db275.tar.gz krb5-dac851d4a5f25c7924d5bdd48900f3b56f5db275.tar.xz krb5-dac851d4a5f25c7924d5bdd48900f3b56f5db275.zip |
Cleanup memory in asn.1 testsuite to allow for leak checking
* krb5_decode_test.c: Modify decode_run macro to take a cleanup
handler to free allocated memory. Add static handlers to free
krb5_alt_method, passwd_phrase_element and krb5_enc_data as the
krb5 library does not handle at this time.
* krb5_encode_test.c: Free krb5_context at end. Utilize the many
ktest_empty and detroy functions to cleanup memory.
* ktest.h, ktest.c: Add many ktest free and empty functions to
cleanup allocated structures in tests.
* utility.c (krb5_data_hex_parse): Free temporary data.
With these changes, one can then test for memory leaks in the
asn.1 and krb5_free functions.
ticket: new
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15413 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/tests/asn.1/ktest.h')
-rw-r--r-- | src/tests/asn.1/ktest.h | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/src/tests/asn.1/ktest.h b/src/tests/asn.1/ktest.h index 5c8175c65..915f36a00 100644 --- a/src/tests/asn.1/ktest.h +++ b/src/tests/asn.1/ktest.h @@ -127,6 +127,8 @@ void ktest_destroy_principal (krb5_principal *p); void ktest_destroy_checksum (krb5_checksum **cs); +void ktest_empty_keyblock + (krb5_keyblock *kb); void ktest_destroy_keyblock (krb5_keyblock **kb); void ktest_destroy_authdata @@ -137,14 +139,65 @@ void ktest_destroy_sequence_of_ticket (krb5_ticket ***sot); void ktest_destroy_ticket (krb5_ticket **tkt); +void ktest_empty_ticket + (krb5_ticket *tkt); void ktest_destroy_enc_data (krb5_enc_data *ed); - +void ktest_empty_error + (krb5_error * kerr); void ktest_destroy_etype_info_entry (krb5_etype_info_entry *i); void ktest_destroy_etype_info (krb5_etype_info_entry **info); +void ktest_empty_kdc_req + (krb5_kdc_req *kr); +void ktest_empty_kdc_rep + (krb5_kdc_rep *kr); + +void ktest_empty_authenticator + (krb5_authenticator *a); +void ktest_empty_enc_tkt_part + (krb5_enc_tkt_part * etp); +void ktest_destroy_enc_tkt_part + (krb5_enc_tkt_part ** etp); +void ktest_empty_enc_kdc_rep_part + (krb5_enc_kdc_rep_part * ekr); +void ktest_destroy_transited + (krb5_transited * t); +void ktest_empty_ap_rep + (krb5_ap_rep * ar); +void ktest_empty_ap_req + (krb5_ap_req * ar); +void ktest_empty_cred_enc_part + (krb5_cred_enc_part * cep); +void ktest_destroy_cred_info + (krb5_cred_info ** ci); +void ktest_destroy_sequence_of_cred_info + (krb5_cred_info *** soci); +void ktest_empty_safe + (krb5_safe * s); +void ktest_empty_priv + (krb5_priv * p); +void ktest_empty_priv_enc_part + (krb5_priv_enc_part * pep); +void ktest_empty_cred + (krb5_cred * c); +void ktest_destroy_last_req + (krb5_last_req_entry *** lr); +void ktest_empty_ap_rep_enc_part + (krb5_ap_rep_enc_part * arep); +void ktest_empty_passwd_phrase_element + (passwd_phrase_element * ppe); +void ktest_empty_pwd_data + (krb5_pwd_data * pd); +void ktest_empty_alt_method + (krb5_alt_method *am); +void ktest_empty_sam_challenge + (krb5_sam_challenge * p); +void ktest_empty_sam_response + (krb5_sam_response * p); + extern krb5_context test_context; extern char *sample_principal_name; |