* init_ets.c (krb5_init_ets): Only initialize error tables once -
authorEzra Peisach <epeisach@mit.edu>
Sat, 19 Jul 2003 20:07:18 +0000 (20:07 +0000)
committerEzra Peisach <epeisach@mit.edu>
Sat, 19 Jul 2003 20:07:18 +0000 (20:07 +0000)
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
src/lib/krb5/error_tables/init_ets.c

index 0e380c1c8353275148ec23252d01cf408ba512ae..2eb6925ac5dd5d24c81c89b5b68b3ad53439219c 100644 (file)
@@ -1,3 +1,9 @@
+2003-07-19  Ezra Peisach  <epeisach@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * Makefile.in (LIBNAME) [##WIN16##]: Don't define.
index a3bf5aac5f28f7e0b7fff6e6a547933903ea8a2a..56a750e75109ded310620ec61bd52299113692fa 100644 (file)
 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