* get_in_tkt.c (krb5_get_init_creds): Free tempstr on non-error
authorTom Yu <tlyu@mit.edu>
Tue, 16 Aug 2005 00:38:17 +0000 (00:38 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 16 Aug 2005 00:38:17 +0000 (00:38 +0000)
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

src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/get_in_tkt.c

index 4128f0afb5337836f69dabe0c164ffb867a235f9..9a695a8854b0102af44be1114a3b509a2c9c5e8f 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 {