From dd3a318cba2783a323e83781763225d398c9317b Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Sat, 19 Jul 2003 20:07:18 +0000 Subject: [PATCH] * init_ets.c (krb5_init_ets): Only initialize error tables once - so that init_conext/free_context loops do not result in memory leaks. I did not implement the remove error table functions - as a system installed com_err library might not support remove_error_table that exists in our trees com_err library. ticket: 1665 target_version: 1.3.1 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15700 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/error_tables/ChangeLog | 6 ++++++ src/lib/krb5/error_tables/init_ets.c | 15 ++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/lib/krb5/error_tables/ChangeLog b/src/lib/krb5/error_tables/ChangeLog index 0e380c1c8..2eb6925ac 100644 --- a/src/lib/krb5/error_tables/ChangeLog +++ b/src/lib/krb5/error_tables/ChangeLog @@ -1,3 +1,9 @@ +2003-07-19 Ezra Peisach + + * init_ets.c (krb5_init_ets): Only initialize error tables once - + so that init_conext/free_context loops do not result in memory + leaks. + 2003-07-17 Ken Raeburn * Makefile.in (LIBNAME) [##WIN16##]: Don't define. diff --git a/src/lib/krb5/error_tables/init_ets.c b/src/lib/krb5/error_tables/init_ets.c index a3bf5aac5..56a750e75 100644 --- a/src/lib/krb5/error_tables/init_ets.c +++ b/src/lib/krb5/error_tables/init_ets.c @@ -32,11 +32,16 @@ void krb5_init_ets (krb5_context context) { - initialize_krb5_error_table(); - initialize_kv5m_error_table(); - initialize_kdb5_error_table(); - initialize_asn1_error_table(); - initialize_k524_error_table(); + static int inited = 0; + + if (inited == 0) { + initialize_krb5_error_table(); + initialize_kv5m_error_table(); + initialize_kdb5_error_table(); + initialize_asn1_error_table(); + initialize_k524_error_table(); + inited++; + } } void -- 2.26.2