Fix small memory leak in repeated krb5 context creation and deletion:
authorKen Raeburn <raeburn@mit.edu>
Wed, 13 Oct 2004 02:22:41 +0000 (02:22 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 13 Oct 2004 02:22:41 +0000 (02:22 +0000)
* prof_init.c (profile_init): Don't add error table here.
* prof_file.c (profile_library_initializer): Add it here.
(profile_library_finalizer): Remove it here.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16815 dc483132-0cff-0310-8789-dd5450dbe970

src/util/profile/ChangeLog
src/util/profile/prof_file.c
src/util/profile/prof_init.c

index 146b852fa41ad0e725f7389a3b555487a248d82f..bca4cd0740d99f2059d5f4d9e5b61cea335611df 100644 (file)
@@ -1,3 +1,9 @@
+2004-10-12  Ken Raeburn  <raeburn@mit.edu>
+
+       * prof_init.c (profile_init): Don't add error table here.
+       * prof_file.c (profile_library_initializer): Add it here.
+       (profile_library_finalizer): Remove it here.
+
 2004-09-28  Ken Raeburn  <raeburn@mit.edu>
 
        * prof_file.c (profile_dereference_data_locked): New function.
index f4bdc4bccebd00b52fbc28051f742e32e7b61e8c..e4bed02fd01c6ece45cf367557febc8e2d8d9262 100644 (file)
@@ -50,6 +50,7 @@ MAKE_FINI_FUNCTION(profile_library_finalizer);
 
 int profile_library_initializer(void)
 {
+    add_error_table(&et_prof_error_table);
 #ifdef SHARE_TREE_DATA
     return k5_mutex_finish_init(&g_shared_trees_mutex);
 #else
@@ -63,6 +64,7 @@ void profile_library_finalizer(void)
 #ifdef SHARE_TREE_DATA
     k5_mutex_destroy(&g_shared_trees_mutex);
 #endif
+    remove_error_table(&et_prof_error_table);
 }
 
 static void profile_free_file_data(prf_data_t);
index de09d783264fa932ba5386d0bf6709bf58b4ed1c..df01256fa16c922925381ceefcd21ee8ff55bc30 100644 (file)
@@ -31,8 +31,6 @@ profile_init(const_profile_filespec_t *files, profile_t *ret_profile)
        prf_file_t  new_file, last = 0;
        errcode_t retval = 0;
 
-       initialize_prof_error_table();
-
        profile = malloc(sizeof(struct _profile_t));
        if (!profile)
                return ENOMEM;