FIX ! (Was: Re: FCGI/perl memory leakage)

Sven Verdoolaege (skimo@breughel.ufsia.ac.be)
Tue, 15 Apr 1997 10:39:19 +0200

Message-Id: <19970415103919.CF37585@breughel.ufsia.ac.be>
Date: Tue, 15 Apr 1997 10:39:19 +0200
From: skimo@breughel.ufsia.ac.be (Sven Verdoolaege)
To: fastcgi-developers@OpenMarket.com
Subject: FIX ! (Was: Re: FCGI/perl memory leakage)
In-Reply-To: <19970407172529.HR30367@breughel.ufsia.ac.be>; from Sven Verdoolaege on Apr 7, 1997 17:25:29 +0200

On Apr 7, skimo@breughel.ufsia.ac.be (Sven Verdoolaege) wrote:
> On Apr 2, skimo@breughel.ufsia.ac.be (Sven Verdoolaege) wrote:
> > I think I've located the problem.
> > perl is trying to be smart and postpones the desruction of hash elements
> > till ... never in this case.
> 
> This is probably misinformation. The problem seem to be more involved,
> but it does seem to be a perl problem.
> 
It was misinformation; the correct fix is

--- util.c.orig	Mon Apr 14 22:07:12 1997
+++ util.c	Mon Apr 14 22:07:27 1997
@@ -1350,6 +1350,7 @@
 	environ = tmpenv;		/* tell exec where it is now */
     }
     if (!val) {
+	if (environ[i]) Safefree(environ[i]);
 	while (environ[i]) {
 	    environ[i] = environ[i+1];
 	    i++;

Remember to remove all the changes you might have done
to the FCGI module.
I've posted the fix to perlporters, but I can't guarantee
it'll be in 5.004 .

skimo