summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTheodore Tso <tytso@mit.edu>1994-09-23 02:42:51 +0000
committerTheodore Tso <tytso@mit.edu>1994-09-23 02:42:51 +0000
commit20a1e94f417eb8c0ad75667fc37feb919ff8042b (patch)
treebb2603bea5d37aea61c9c7ebe9a0513396e2a9b5 /src
parent64380cf37e33b8771e7c703ef4ba5fb230d9745d (diff)
Fix memory leak in klist --- the returned credentials should be freed before
the next set is fetched. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4339 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/clients/klist/ChangeLog5
-rw-r--r--src/clients/klist/Makefile.in6
-rw-r--r--src/clients/klist/klist.c4
3 files changed, 11 insertions, 4 deletions
diff --git a/src/clients/klist/ChangeLog b/src/clients/klist/ChangeLog
new file mode 100644
index 000000000..bbdd39d82
--- /dev/null
+++ b/src/clients/klist/ChangeLog
@@ -0,0 +1,5 @@
+Thu Sep 22 22:41:42 1994 Theodore Y. Ts'o (tytso@dcl)
+
+ * klist.c (main): Fix memory leak in klist --- the returned
+ credentials should be freed before you fetch the next set.
+
diff --git a/src/clients/klist/Makefile.in b/src/clients/klist/Makefile.in
index 0a7ba6888..f6567fede 100644
--- a/src/clients/klist/Makefile.in
+++ b/src/clients/klist/Makefile.in
@@ -3,13 +3,13 @@ LDFLAGS = -g
ISODELIB=@ISODELIB@
COMERRLIB=$(BUILDTOP)/util/et/libcom_err.a
-DBMLIB=
all::
-KLIB = $(TOPLIBD)/libkrb5.a $(TOPLIBD)/libcrypto.a $(ISODELIB) $(COMERRLIB) $(DBMLIB)
+KLIB = $(TOPLIBD)/libkrb5.a $(TOPLIBD)/libcrypto.a $(ISODELIB) $(COMERRLIB)
+DEPKLIB = $(TOPLIBD)/libkrb5.a $(TOPLIBD)/libcrypto.a $(ISODELIB) $(COMERRLIB)
-klist: klist.o
+klist: klist.o $(DEPKLIB)
$(CC) $(CFLAGS) -o klist klist.o $(KLIB)
klist.o: $(srcdir)/klist.c
diff --git a/src/clients/klist/klist.c b/src/clients/klist/klist.c
index a5ab8a66a..188c406a0 100644
--- a/src/clients/klist/klist.c
+++ b/src/clients/klist/klist.c
@@ -132,8 +132,10 @@ main(argc, argv)
}
fputs(" Valid starting Expires Service principal\n",
stdout);
- while (!(code = krb5_cc_next_cred(cache, &cur, &creds)))
+ while (!(code = krb5_cc_next_cred(cache, &cur, &creds))) {
show_credential(&creds);
+ krb5_free_cred_contents(&creds);
+ }
if (code == KRB5_CC_END) {
if (code = krb5_cc_end_seq_get(cache, &cur)) {
com_err(progname, code, "while finishing ticket retrieval");