From: Richard Basch Date: Fri, 15 Mar 1996 19:35:51 +0000 (+0000) Subject: Corrected several memory leaks and unreferenced memory access conditions X-Git-Tag: krb5-1.0-beta6~358 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=24c846cd057ce1eafb15ec6b027fe00c87e0a492;p=krb5.git Corrected several memory leaks and unreferenced memory access conditions git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7644 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/slave/ChangeLog b/src/slave/ChangeLog index 8c2eaa918..7a2ea9c3d 100644 --- a/src/slave/ChangeLog +++ b/src/slave/ChangeLog @@ -1,3 +1,8 @@ +Fri Mar 15 14:33:06 1996 Richard Basch + + * kprop.c: Corrected various memory leaks and unreferenced + memory access conditions. + Tue Mar 12 14:01:32 1996 Richard Basch * kprop.c: Write a byte to the last-prop file to ensure the file diff --git a/src/slave/kprop.c b/src/slave/kprop.c index c0c315cc4..a5842d34b 100644 --- a/src/slave/kprop.c +++ b/src/slave/kprop.c @@ -63,7 +63,7 @@ krb5_address sender_addr; krb5_address receiver_addr; void PRS - PROTOTYPE((krb5_context, char **)); + PROTOTYPE((int, char **)); void get_tickets PROTOTYPE((krb5_context)); static void usage @@ -104,8 +104,9 @@ main(argc, argv) krb5_auth_context auth_context; char Errmsg[256]; - PRS(context, argv); krb5_init_context(&context); + krb5_init_ets(context); + PRS(argc, argv); get_tickets(context); database_fd = open_database(context, file, &database_size); @@ -130,16 +131,14 @@ main(argc, argv) exit(0); } -void PRS(context, argv) - krb5_context context; +void PRS(argc, argv) + int argc; char **argv; { register char *word, ch; - krb5_init_context(&context); - krb5_init_ets(context); progname = *argv++; - while (word = *argv++) { + while (--argc && (word = *argv++)) { if (*word == '-') { word++; while (word && (ch = *word++)) { @@ -287,6 +286,10 @@ void get_tickets(context) (void) krb5_cc_destroy(context, ccache); exit(1); } + + if (keytab) + (void) krb5_kt_close(context, keytab); + /* * Now destroy the cache right away --- the credentials we * need will be in my_creds.