* kfree.c (krb5_free_pwd_sequences): Actually free the entire
sequence of passwd_phase_elements and not just the first one.
In our tree, this code is only used by krb5_free_pwd_data() which is
subsequently not used anywhere else. Perhaps all code pertaining to pwd
data (asn.1 decoders, encoders, etc. should be removed)
ticket: new
component: krb5-libs
target_version: 1.3
tags: pullup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15364
dc483132-0cff-0310-8789-
dd5450dbe970
+2003-04-23 Ezra Peisach <epeisach@mit.edu>
+
+ * kfree.c (krb5_free_pwd_sequences): Actually free the entire
+ sequence of passwd_phase_elements and not just the first one.
+
2003-04-13 Ken Raeburn <raeburn@mit.edu>
* init_ctx.c (DEFAULT_ETYPE_LIST): Add AES with 256 bits at the
void KRB5_CALLCONV
krb5_free_pwd_sequences(krb5_context context, passwd_phrase_element **val)
{
- if ((*val)->passwd) {
- krb5_xfree((*val)->passwd);
- (*val)->passwd = 0;
- }
- if ((*val)->phrase) {
- krb5_xfree((*val)->phrase);
- (*val)->phrase = 0;
+ register passwd_phrase_element **temp;
+
+ for (temp = val; *temp; temp++) {
+ if ((*temp)->passwd) {
+ krb5_xfree((*temp)->passwd);
+ (*temp)->passwd = 0;
+ }
+ if ((*temp)->phrase) {
+ krb5_xfree((*temp)->phrase);
+ (*temp)->phrase = 0;
+ }
+ krb5_xfree(*temp);
}
+ krb5_xfree(val);
}