Clean up memory leaks at end of program. No leaks now on success
authorEzra Peisach <epeisach@mit.edu>
Sun, 6 Mar 2011 13:29:54 +0000 (13:29 +0000)
committerEzra Peisach <epeisach@mit.edu>
Sun, 6 Mar 2011 13:29:54 +0000 (13:29 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24688 dc483132-0cff-0310-8789-dd5450dbe970

src/appl/user_user/client.c
src/appl/user_user/server.c

index 39bd188e2f116440ff4c939c7aa23ac45d655c4e..891eb9f46d85d34a7a2837a281a241304e22b3ac 100644 (file)
@@ -278,5 +278,17 @@ int main (int argc, char *argv[])
     }
 
     printf ("uu-client: server says \"%s\".\n", msg.data);
+
+
+    krb5_free_ticket(context, ticket);
+    krb5_free_host_realm(context, srealms);
+    free(hname);
+    krb5_free_cred_contents(context, &creds);
+    krb5_free_creds(context, new_creds);
+    krb5_free_data_contents(context, &msg);
+    krb5_free_data_contents(context, &reply);
+    krb5_cc_close(context, cc);
+    krb5_auth_con_free(context, auth_context);
+    krb5_free_context(context);
     return 0;
 }
index b3cfcc1639b422758c227931537939f7590c337e..299c2ac7ade3d6d641a0925fa2a33dbf7c651552 100644 (file)
@@ -238,5 +238,14 @@ int main(argc, argv)
         return 7;
     }
 
+
+    krb5_free_data_contents(context, &msg);
+    krb5_free_data_contents(context, &pname_data);
+    /* tkt_data freed with creds */
+    krb5_free_cred_contents(context, &creds);
+    krb5_free_creds(context, new_creds);
+    krb5_cc_close(context, cc);
+    krb5_auth_con_free(context, auth_context);
+    krb5_free_context(context);
     return 0;
 }