From 082eb76c60a133e6e39a585483fa66908889c52b Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 22 Jun 2007 18:55:46 +0000 Subject: [PATCH] 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/trunk@19625 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