W3C home > Mailing lists > Public > www-lib@w3.org > January to March 1999

Crashing in HTMIME

From: olga <olga@goliath.eai.com>
Date: Fri, 29 Jan 1999 13:33:07 -0600 (CST)
Message-ID: <XFMail.990129133307.olga@eai.com>
To: www-lib@w3.org
Hi,

It is possible that debug stack of the request is used several times.
For example first time when 401 is returned by server, second time when 304 is
returned by server. 

For the 401 server response the stream stack is created and it contains a debug
stream gotten from request, headers are parsed and stack is freed (debug
file-ftream is freed also).

For 304 debug file-stream of the request is tried to be used again and
application dumps.

To avoid this I have changed the code to immediately return HT_OK after
flushing file if leave-open is set to YES. This stops coredumps but allows the
memory leaks. 

In HTFWrite.c:

PRIVATE int HTFWriter_free (HTStream * me)
{
    if (me) {
                if (me->leave_open != YES) {
                    if (STREAM_TRACE) HTTrace("HTFWriter_free: ~~~~~ Closing fp
= %d\n",         me->fp);
                    
                    
                    fclose(me->fp);
                }
                
                else {
                    
                    HTFWriter_flush(me) 
                    return HT_OK;           // HERE
            
            }
  
              ...        

I think that debug stream could be freed in HTRequest_delete.

Thanks,

Olga Antropova. 


----------------------------------
E-Mail: olga <olga@eai.com>
Date: 29-Jan-99
Time: 13:12:21

This message was sent by XFMail
----------------------------------
Received on Friday, 29 January 1999 14:29:21 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 23 April 2007 18:18:28 GMT