correctly plug the leak
authorJohn Kohl <jtkohl@mit.edu>
Thu, 21 Feb 1991 15:49:22 +0000 (15:49 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Thu, 21 Feb 1991 15:49:22 +0000 (15:49 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1759 dc483132-0cff-0310-8789-dd5450dbe970

src/tests/hammer/kdc5_hammer.c

index 41f41f3c41ced4f0126f8c2bfc6653d788bb2e0e..87bda9ee298b37934bfbf0a15d078920450516ab 100644 (file)
@@ -196,7 +196,6 @@ main(argc, argv)
          strcat(ctmp, ctmp2);
          client = ctmp;
 
-         if ((counter != 0) && (n != 1)) krb5_free_principal(client_princ);
          if (get_tgt (client, &client_princ, ccache)) {
            errors++;
            n_tried++;
@@ -215,6 +214,7 @@ main(argc, argv)
              errors++;
            n_tried++;
          }
+         krb5_free_principal(client_princ);
        }
       }
     }
@@ -398,7 +398,8 @@ int get_tgt (p_client_str, p_client, ccache)
                                         p_client_str,
                                         ccache,
                                         &my_creds);
-    my_creds.server = 0;
+    my_creds.server = my_creds.client = 0;
+    krb5_free_address(my_addresses);
     krb5_free_cred_contents(&my_creds);
     if (code != 0) {
        com_err (prog, code, "while getting initial credentials");