[677] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

memory leak in ktf_remove.c

daemon@ATHENA.MIT.EDU (Bill Sommerfeld)
Wed Aug 24 16:34:52 1994

Date: Wed, 24 Aug 1994 16:34:26 -0400
From: Bill Sommerfeld <sommerfeld@apollo.hp.com>
To: krb5-bugs@MIT.EDU

There is a small memory leak in lib/krb5/keytab/file/ktf_remove.c.

For reasons I don't fully understand, most of the "destructor"
functions in krb5 only free the contents of structures and don't
actually free the top-level structures themselves.

In krb5_ktfile_remove, every trip through the loop allocates a new
top-level krb5_keytab_entry structure in cur_entry, which gets
stranded at the top.

To fix this, you should add a

krb5_xfree(cur_entry)

just after each of the calls to krb5_kt_free_entry() in that function.

						- Bill

home help back first fref pref prev next nref lref last post