From 9e84f3f710738cf79e89a015adfde4bb6174b8aa Mon Sep 17 00:00:00 2001 From: "Janet B. Anderson" Date: Sat, 18 Dec 1993 10:52:19 +0000 Subject: [PATCH] for jhill CA memory leak at ca_task_exit() --- src/ca/access.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/ca/access.c b/src/ca/access.c index 365883527..2f212ba44 100644 --- a/src/ca/access.c +++ b/src/ca/access.c @@ -88,6 +88,7 @@ /* ca_process_exit() under all os and not just */ /* vxWorks */ /* 120293 joh flush in ca_pend_io() if no IO oustanding */ +/* 121693 joh fixed bucketLib level memory leak */ /* */ /*_begin */ /************************************************************************/ @@ -842,9 +843,7 @@ LOCAL void ca_process_exit() struct ca_static *ca_temp; evid monix; IIU *piiu; -#ifdef vxWorks int status; -#endif # if defined(DEBUG) && defined(vxWorks) ca_printf("CAC: entering the exit handler 2 %x\n", tid); @@ -1021,6 +1020,18 @@ LOCAL void ca_process_exit() while (monix = (evid) ellGet(&chix->eventq)) { free((char *)monix); } + /* + * release entries in the bucket table + */ + status = bucketRemoveItem( + pBucket, + chix->cid, + chix); + if(status != BUCKET_SUCCESS){ + ca_signal( + ECA_INTERNAL, + "bad chid at exit"); + } free((char *)chix); } piiu = (struct ioc_in_use *) piiu->node.next; @@ -1065,6 +1076,14 @@ LOCAL void ca_process_exit() */ ellFree(&ca_temp->ca_iiuList); + /* + * free top level bucket + */ + status = bucketFree(pBucket); + if(status != BUCKET_SUCCESS){ + ca_signal(ECA_INTERNAL, "top level bucket free failed"); + } + /* * free beacon hash table */