diff options
author | Greg Hudson <ghudson@mit.edu> | 2009-04-23 14:55:42 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2009-04-23 14:55:42 +0000 |
commit | 7688f9f3f8d4ac8eb4b5df1454898e17fb3ee46c (patch) | |
tree | 41c842e5fbdc00d2ebab515ecb924ba252a350a9 /src/lib/krb5/asn.1 | |
parent | 4a58548d6e2af0d4c1b3c26bfc0b88f0223cf7ac (diff) | |
download | krb5-7688f9f3f8d4ac8eb4b5df1454898e17fb3ee46c.zip krb5-7688f9f3f8d4ac8eb4b5df1454898e17fb3ee46c.tar.gz krb5-7688f9f3f8d4ac8eb4b5df1454898e17fb3ee46c.tar.bz2 |
Close a memory leak in asn1_decode_etype_info2_entry_1_3
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@22275 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/asn.1')
-rw-r--r-- | src/lib/krb5/asn.1/asn1_k_decode.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/krb5/asn.1/asn1_k_decode.c b/src/lib/krb5/asn.1/asn1_k_decode.c index 38fa1a2..1917d89 100644 --- a/src/lib/krb5/asn.1/asn1_k_decode.c +++ b/src/lib/krb5/asn.1/asn1_k_decode.c @@ -1209,6 +1209,8 @@ asn1_decode_etype_info2_entry_ptr(asn1buf *buf, krb5_etype_info_entry **valptr) static asn1_error_code asn1_decode_etype_info2_entry_1_3(asn1buf *buf, krb5_etype_info_entry *val ) { + krb5_octet *params = NULL; + setup(); val->salt = NULL; val->s2kparams.data = NULL; @@ -1219,10 +1221,10 @@ static asn1_error_code asn1_decode_etype_info2_entry_1_3(asn1buf *buf, krb5_etyp } else val->length = KRB5_ETYPE_NO_SALT; if ( tagnum ==2) { - krb5_octet *params ; get_lenfield( val->s2kparams.length, params, 2, asn1_decode_octetstring); val->s2kparams.data = ( char *) params; + params = NULL; } else val->s2kparams.length = 0; end_structure(); @@ -1231,6 +1233,7 @@ static asn1_error_code asn1_decode_etype_info2_entry_1_3(asn1buf *buf, krb5_etyp return 0; error_out: krb5_free_data_contents(NULL, &val->s2kparams); + free(params); free(val->salt); val->salt = NULL; return retval; |