I was told this was a PHP problem, and to submit a bug report. I'm not
too sure what such a bug report would look like, or even if this is a
PHP problem.

Below is the message I sent to an Apache list, could someone tell me
whether my problem is crummy code, or an actual problem with PHP/Apache?


-----Original Message-----
From: Chris Cameron [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 10, 2001 12:40 PM
Subject: PHP Script causing recursive free() calls (?)

I've got quite a problem with part of a PHP script I wrote causing
Apache too fill up it's error logs with:
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
httpd in malloc(): warning: recursive call.
FATAL:  emalloc():  Unable to allocate 256 bytes

Each call of this script will put about 20 megs in my error log.
My Apache setup is:
Apache/1.3.20 (Unix)

And my phpinfo page is at chris.upnix.com/index.php

The part of my PHP script that's causing the problem (sorry about the
/* If no errors, submit junk to database */
if(!isset($Error)) {
        for($i = 1; $i <= $Days; $i++) {
                /* Write to bookings first */
                $QueryString = "INSERT INTO bookings VALUES(nextval('BID'),
'$CompanyID', '" . $TimeSpan[$i] . "', '$TimeF', '$TimeT',
                $Query = pg_exec($Connect, $QueryString);
                $OID = pg_getlastoid($Query);
                /* Find the BID we were given */
                $QueryString = "SELECT bid FROM bookings WHERE oid = '" . $OID . "'";
                $Query = pg_exec($Connect, $QueryString);
                $Result = pg_fetch_array($Query, 0);
                $BID = $Result['bid'];
                /* Go through our therapists */
                foreach($Therapists[$i] as $Key => $TherapistID) {
                        $QueryString = "INSERT INTO bookedtherapist VALUES('" . $BID . 
'$TherapistID', '$TimeF', '$TimeT')";
                        pg_exec($Connect, $QueryString);
        /* Everything Should be done, send us off to schview.php */
        header("Location: " . $BaseURL . "admin/schview.php");

I've tried rewriting little parts of this script, but haven't had any
luck in stopping the errors. Also, I've recompiled everything twice now,
which also didn't help. Any help would be appreciated.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to