Article View: news.software.nntp
Article #20795FIX: 1.6b3 memory leak in expireover - expire~1.dif [1/1]
From: Forrest J. Cavalier III
Date: Fri, 22 Aug 1997 00:00
Date: Fri, 22 Aug 1997 00:00
51 lines
2132 bytes
2132 bytes
--*- Boundary Sn946+gqUW.Dq?'d-VSF
Content-Type: Text/Plain; charset=US-ASCII
INN 1.6b3/expire/expireover has a significant memory leak,
basically it allocates new space to store the headers for
each article processed, and never frees them.
I reported it to inn-workers yesterday, and I confirmed it
in "unit" testing today.
I don't know why code which appeared to work in 1.5.1 was
changed to what is in 1.6b3, but here is the fix for
1.6b3, and probably every 1.6.
(The fix is a bit "wordy" but it should make it safe even
if it is installed in 1.5.1 or 1.5.1sec2 by accident.)
Forrest Cavalier, Mib Software, INN customization and consulting
--*- Boundary Sn946+gqUW.Dq?'d-VSFL
Content-Type: Text/Plain; charset=ISO-8859-1
*** inn-1.6b3\expire\expireover.c.orig Thu Jul 31 08:34:40 1997
--- inn-1.6b3\expire\expireover.c Fri Aug 22 10:25:36 1997
***************
*** 451,456 ****
--- 451,469 ----
Headers = NEW(ARTOVERFIELD, ARTfieldsize);
for (hp = Headers, i = ARTfieldsize; --i >= 0; hp++)
hp->Length = 0;
+ } else {
+ /* This disposes from the previous call. This simplifies
+ handling later on. We trade off this readable code
+ for the problem that nothing DISPOSEs() the last
+ caller's use. mibsoft 8/22/97
+ */
+ for (hp = Headers, i = ARTfieldsize; --i >= 0; hp++) {
+ if (hp->Header) {
+ DISPOSE(hp->Header);
+ hp->Header = 0;
+ }
+ hp->Length = 0;
+ }
}
for (hp = Headers, i = ARTfieldsize; --i >= 0; hp++)
hp->HasHeader = FALSE;
--*- Boundary Sn946+gqUW.Dq?'d-VSF---
Technical Details
Message-ID:
<5tkahi$5gj$4@news1.epix.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <5tkahi$5gj$4@news1.epix.net> Subject: FIX: 1.6b3 memory leak in expireover - expire~1.dif [1/1] Date: Fri, 22 Aug 1997 00:00:00 +0000 From: mibsoft@epix.net (Forrest J. Cavalier III) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 267957450 Organization: Mib Software Newsgroups: news.software.nntp