From: Tom Yu Date: Tue, 16 Aug 2005 00:38:17 +0000 (+0000) Subject: * get_in_tkt.c (krb5_get_init_creds): Free tempstr on non-error X-Git-Tag: ms-bug-test-20060525~179 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d1fa0b0e1d695208fc76c8c5ea64522d1330d941;p=krb5.git * get_in_tkt.c (krb5_get_init_creds): Free tempstr on non-error returns from krb5_string_to_deltat() to avoid memory leak. ticket: 3147 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17330 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 4128f0afb..9a695a885 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,8 @@ +2005-08-15 Tom Yu + + * get_in_tkt.c (krb5_get_init_creds): Free tempstr on non-error + returns from krb5_string_to_deltat() to avoid memory leak. + 2005-07-12 Tom Yu * recvauth.c (recvauth_common): Avoid double-free on invalid diff --git a/src/lib/krb5/krb/get_in_tkt.c b/src/lib/krb5/krb/get_in_tkt.c index 0ab3515ce..462dc7c82 100644 --- a/src/lib/krb5/krb/get_in_tkt.c +++ b/src/lib/krb5/krb/get_in_tkt.c @@ -841,8 +841,9 @@ krb5_get_init_creds(krb5_context context, } else if ((ret = krb5_libdefault_string(context, &client->realm, "ticket_lifetime", &tempstr)) == 0) { - if ((ret = krb5_string_to_deltat(tempstr, &tkt_life))) { - free(tempstr); + ret = krb5_string_to_deltat(tempstr, &tkt_life); + free(tempstr); + if (ret) { goto cleanup; } } else { @@ -858,8 +859,9 @@ krb5_get_init_creds(krb5_context context, } else if ((ret = krb5_libdefault_string(context, &client->realm, "renew_lifetime", &tempstr)) == 0) { - if ((ret = krb5_string_to_deltat(tempstr, &renew_life))) { - free(tempstr); + ret = krb5_string_to_deltat(tempstr, &renew_life); + free(tempstr); + if (ret) { goto cleanup; } } else {