From dc80bd870e311c07d9f422d4bdf4ce6d2dee3a5e Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Thu, 22 Feb 1996 13:11:38 +0000 Subject: [PATCH] Do not free memory before done using it. (The credential was pointing to memory that is freed and then referenced again) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7501 dc483132-0cff-0310-8789-dd5450dbe970 --- src/clients/kinit/ChangeLog | 4 ++++ src/clients/kinit/kinit.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/clients/kinit/ChangeLog b/src/clients/kinit/ChangeLog index 87bf40b8f..b7c2ed728 100644 --- a/src/clients/kinit/ChangeLog +++ b/src/clients/kinit/ChangeLog @@ -1,3 +1,7 @@ +Thu Feb 15 12:31:03 1996 Ezra Peisach + + * kinit.c (main): Do not free memory until all done using it. + Tue Sep 26 22:19:32 1995 Mark Eichin * kinit.c (KRB5_DEFAULT_LIFE): default life should be 10 hours, diff --git a/src/clients/kinit/kinit.c b/src/clients/kinit/kinit.c index 1e3a802b6..38e3d751c 100644 --- a/src/clients/kinit/kinit.c +++ b/src/clients/kinit/kinit.c @@ -273,8 +273,6 @@ main(argc, argv) #endif } - krb5_free_principal(kcontext, server); - if (code) { if (code == KRB5KRB_AP_ERR_BAD_INTEGRITY) fprintf (stderr, "%s: Password incorrect\n", argv[0]); @@ -296,5 +294,10 @@ main(argc, argv) exit(1); } + /* my_creds is pointing at server */ + krb5_free_principal(kcontext, server); + + krb5_free_context(kcontext); + exit(0); } -- 2.26.2