From: Ezra Peisach Date: Mon, 24 May 2004 19:43:17 +0000 (+0000) Subject: (main): Invoke krb5_free_context at exit to allow X-Git-Tag: krb5-1.4-beta1~407 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=343026c5d8aa860687a071e19f650bd9cd516755;p=krb5.git (main): Invoke krb5_free_context at exit to allow checking for memory leaks. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16353 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 5ccedd292..97337ec80 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,7 @@ +2004-05-24 Ezra Peisach + + * krsh.c (main): Invoke krb5_free_context at exit. + 2004-02-24 Ken Raeburn * Makefile.in (kshd, klogind): Link against apputils lib. diff --git a/src/appl/bsd/krsh.c b/src/appl/bsd/krsh.c index bd9c20572..08b68fef1 100644 --- a/src/appl/bsd/krsh.c +++ b/src/appl/bsd/krsh.c @@ -127,7 +127,7 @@ main(argc, argv0) int argc; char **argv0; { - int rem, pid; + int rem, pid = 0; char *host=0, *cp, **ap, buf[RCMD_BUFSIZ], *args, **argv = argv0, *user = 0; register int cc; struct passwd *pwd; @@ -533,6 +533,9 @@ main(argc, argv0) goto rewrite; done: (void) shutdown(rem, 1); +#ifdef KERBEROS + krb5_free_context(bsd_context); +#endif exit(0); } #ifdef POSIX_SIGNALS @@ -575,6 +578,9 @@ main(argc, argv0) } while (FD_ISSET(rem, &readfrom) || FD_ISSET(rfd2, &readfrom)); if (nflag == 0) (void) kill(pid, SIGKILL); +#ifdef KERBEROS + krb5_free_context(bsd_context); +#endif exit(0); usage: fprintf(stderr,