From: Ken Raeburn Date: Wed, 13 Oct 2004 02:22:41 +0000 (+0000) Subject: Fix small memory leak in repeated krb5 context creation and deletion: X-Git-Tag: krb5-1.4-beta1~26 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f03e8f6e527cafe0319ee82a3f5aefc15a802edd;p=krb5.git Fix small memory leak in repeated krb5 context creation and deletion: * 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 --- diff --git a/src/util/profile/ChangeLog b/src/util/profile/ChangeLog index 146b852fa..bca4cd074 100644 --- a/src/util/profile/ChangeLog +++ b/src/util/profile/ChangeLog @@ -1,3 +1,9 @@ +2004-10-12 Ken Raeburn + + * 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 * prof_file.c (profile_dereference_data_locked): New function. diff --git a/src/util/profile/prof_file.c b/src/util/profile/prof_file.c index f4bdc4bcc..e4bed02fd 100644 --- a/src/util/profile/prof_file.c +++ b/src/util/profile/prof_file.c @@ -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); diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c index de09d7832..df01256fa 100644 --- a/src/util/profile/prof_init.c +++ b/src/util/profile/prof_init.c @@ -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;