diff options
author | Theodore Tso <tytso@mit.edu> | 1994-09-21 20:55:11 +0000 |
---|---|---|
committer | Theodore Tso <tytso@mit.edu> | 1994-09-21 20:55:11 +0000 |
commit | 787858e0528df604a6e88abe19f7b3fff76f3502 (patch) | |
tree | 096d384deeaba10939edd7e0bf88edd252724133 /src/lib/krb5/asn.1/asn1_decode.c | |
parent | 2ad4b37c492deb14b5b585f043f7a72b1c544a5f (diff) | |
download | krb5-787858e0528df604a6e88abe19f7b3fff76f3502.zip krb5-787858e0528df604a6e88abe19f7b3fff76f3502.tar.gz krb5-787858e0528df604a6e88abe19f7b3fff76f3502.tar.bz2 |
Fix memory leak in decode timestamp return
Initialize return variable in decode_krb5_authdata()
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4327 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/asn.1/asn1_decode.c')
-rw-r--r-- | src/lib/krb5/asn.1/asn1_decode.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/krb5/asn.1/asn1_decode.c b/src/lib/krb5/asn.1/asn1_decode.c index 76304ec..40ead94 100644 --- a/src/lib/krb5/asn.1/asn1_decode.c +++ b/src/lib/krb5/asn.1/asn1_decode.c @@ -191,7 +191,10 @@ asn1_error_code asn1_decode_generaltime(DECLARG(asn1buf *, buf), if(length != 15) return ASN1_BAD_LENGTH; retval = asn1buf_remove_charstring(buf,15,&s); /* Time encoding: YYYYMMDDhhmmssZ */ - if(s[14] != 'Z') return ASN1_BAD_FORMAT; + if(s[14] != 'Z') { + free(s); + return ASN1_BAD_FORMAT; + } #define c2i(c) ((c)-'0') ts.tm_year = 1000*c2i(s[0]) + 100*c2i(s[1]) + 10*c2i(s[2]) + c2i(s[3]) - 1900; @@ -202,6 +205,7 @@ asn1_error_code asn1_decode_generaltime(DECLARG(asn1buf *, buf), ts.tm_sec = 10*c2i(s[12]) + c2i(s[13]); ts.tm_isdst = -1; t = gmt_mktime(&ts); + free(s); if(t == -1) return ASN1_BAD_TIMEFORMAT; |