pullup r17330 from trunk (minus cvs2svn metadata)
authorTom Yu <tlyu@mit.edu>
Wed, 7 Sep 2005 22:19:10 +0000 (22:19 +0000)
committerTom Yu <tlyu@mit.edu>
Wed, 7 Sep 2005 22:19:10 +0000 (22:19 +0000)
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
src/lib/krb5/krb/get_in_tkt.c

index 8bbe82cb54440c645253fc27b9ce29bce4009ca1..e14a1bf7c3be2de3a87243ae129727b4fdf71b92 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-15  Tom Yu  <tlyu@mit.edu>
+
+       * 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  <tlyu@mit.edu>
 
        * recvauth.c (recvauth_common): Avoid double-free on invalid
index 0ab3515ceaedaa9babcc461b3b5b46d074f97e99..462dc7c823982b57b6ebf7a765433be842e0aec4 100644 (file)
@@ -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 {