From: Ezra Peisach Date: Sat, 3 Feb 2007 18:09:56 +0000 (+0000) Subject: Memory leak in new memory keytab X-Git-Tag: krb5-1.7-alpha1~1298 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2d12564207af0aa76ecddd131cdc0530e447a915;p=krb5.git Memory leak in new memory keytab The memory keytab introduced in ticket 5411 suffers from a memory leak in the Heimdal compatible kt_close() handling and thread destructor in which the cursor->entry is not freed. ticket: new git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19138 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/keytab/kt_memory.c b/src/lib/krb5/keytab/kt_memory.c index f30c7d7b5..5e550d492 100644 --- a/src/lib/krb5/keytab/kt_memory.c +++ b/src/lib/krb5/keytab/kt_memory.c @@ -175,6 +175,7 @@ void krb5int_mkt_finalize(void) { * krb5_context since we know that the context isn't used by * krb5_kt_free_entry or krb5_free_principal. */ krb5_kt_free_entry(NULL, cursor->entry); + krb5_xfree(cursor->entry); krb5_xfree(cursor); } @@ -354,6 +355,7 @@ krb5_mkt_close(krb5_context context, krb5_keytab id) next_cursor = cursor->next; krb5_kt_free_entry(context, cursor->entry); + krb5_xfree(cursor->entry); krb5_xfree(cursor); }