From 51f55f4c00e06ef800749a2bad56696e6ec33c81 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 7 Sep 2005 22:19:10 +0000 Subject: [PATCH] pullup r17330 from trunk (minus cvs2svn metadata) ticket: 3147 version_fixed: 1.4.3 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-4@17374 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/krb/ChangeLog | 5 +++++ src/lib/krb5/krb/get_in_tkt.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 8bbe82cb5..e14a1bf7c 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 { -- 2.26.2