From 6097fe89a62434da50918e7840aa7ca1e862b116 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Thu, 9 Aug 2007 22:11:07 +0000 Subject: [PATCH] pull up r19625 from trunk r19625@cathode-dark-space: jaltman | 2007-06-22 14:55:46 -0400 ticket: 5584 1. When freeing a message type object, it should also be removed from the all_msg_types list. 2. When a type handler is being removed from a message type, we shouldn't re-create the message type object if it has already been destroyed. ticket: 5584 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@19783 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/identity/kmq/msgtype.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/windows/identity/kmq/msgtype.c b/src/windows/identity/kmq/msgtype.c index b7ea21fca..b5b23e920 100644 --- a/src/windows/identity/kmq/msgtype.c +++ b/src/windows/identity/kmq/msgtype.c @@ -104,6 +104,8 @@ void kmqint_free_msg_type(int t) { pt->completion_handler = NULL; + LDELETE(&all_msg_types, pt); + PFREE(pt); } @@ -374,8 +376,12 @@ khm_int32 kmqint_msg_type_set_handler(khm_int32 type, kmq_msg_completion_handler if (type == KMSG_SYSTEM) return KHM_ERROR_INVALID_PARAM; - if(!msg_types[type]) - kmqint_msg_type_create(type); + if(!msg_types[type]) { + if (handler) + kmqint_msg_type_create(type); + else + return KHM_ERROR_SUCCESS; + } if(!msg_types[type]) return KHM_ERROR_NO_RESOURCES; -- 2.26.2