--- /dev/null
+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.
+
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
}
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");