From: Greg Hudson Date: Thu, 23 Apr 2009 14:55:42 +0000 (+0000) Subject: Close a memory leak in asn1_decode_etype_info2_entry_1_3 X-Git-Tag: krb5-1.8-alpha1~531 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7688f9f3f8d4ac8eb4b5df1454898e17fb3ee46c;p=krb5.git 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 --- diff --git a/src/lib/krb5/asn.1/asn1_k_decode.c b/src/lib/krb5/asn.1/asn1_k_decode.c index 38fa1a229..1917d8974 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;