Memory leaks

Alex Kiernan alexk at demon.net
Wed Jul 4 08:17:13 UTC 2001


Alex Kiernan <alexk at demon.net> writes:

> davidsen at tmr.com (bill davidsen) writes:
> 
> > In article <20010213075141Y.kondou at inn.do.mms.mt.nec.co.jp>,
> > Katsuhiro Kondou  <kondou at nec.co.jp> wrote:
> > | 
> > | In article <723ddjhnez.fsf at nd1.eng.demon.net>,
> > | 	Alex Kiernan <alexk at demon.net> wrote;
> > | 
> > | } Is this an obvious one to anyone - I suspect its the enclosing object
> > | } getting freed, without its contents being freed:
> > | 
> > | No, they never be freed.  The region(ARTDATA *data) is actually
> > | static area(included in CHANNEL), and holding pointer and size
> > | are never cleared even if the channel is closed.
> > 
> >   Thank you. I took a few minutes to scan the code to be sure that not
> > only were they (deliberately) not released, they do seem to be reused
> > correctly. In some sense that's too bad, since we had a place to look
> > for the leak.
> 
> I'm working on the basis that Purify's confused, I just haven't had
> time to prove it yet.
> 

Woohoo, Purify's not confused, I've found it (I think)... does this
patch look reasonable to everyone:

Index: chan.c
===================================================================
RCS file: /upstream-repositories/inn-cvs.isc.org/inn/innd/chan.c,v
retrieving revision 1.54
diff -c -r1.54 chan.c
*** chan.c	2001/05/14 04:05:33	1.54
--- chan.c	2001/07/04 08:08:39
***************
*** 343,348 ****
--- 343,358 ----
  		DISPOSE(cp->Data.Path.List);
  		cp->Data.Path.List = NULL;
  	    }
+ 	    if (cp->Data.Overview.Size != 0) {
+ 		DISPOSE(cp->Data.Overview.Data);
+ 		cp->Data.Overview.Data = NULL;
+ 		cp->Data.Overview.Size = 0;
+ 	    }
+ 	    if (cp->Data.XrefBufLength != NULL) {
+ 		DISPOSE(cp->Data.Xref);
+ 		cp->Data.Xref = NULL;
+ 		cp->Data.XrefBufLength = 0;
+ 	    }
  	} else if (cp->Type == CTreject)
  	    syslog(L_NOTICE, "%s %ld", name, cp->Rejected);
  	else if (cp->Out.Left)


Quite why it took me this long to figure them out is beyond me...

-- 
Alex Kiernan, Principal Engineer, Development, Thus PLC


More information about the inn-workers mailing list