[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-filesystem-dev
Subject:    [Filesystem-dev] CN-Client: httpfsys refcount fix (including crash
From:       Bob Clark <bobclark () real ! com>
Date:       2005-01-26 1:15:43
Message-ID: CC91F1B3-6F37-11D9-B103-000A27899172 () real ! com
[Download RAW message or body]

Thanks for the CR, Liam.

Committed to head.

On Tuesday, January 25, 2005, at 05:05 PM, Liam Murray wrote:

> Looks good.
>
> Liam
>
> At 04:31 PM 1/25/2005, Bob Clark wrote:
>> Synopsis:
>>   Remove extraneous pBuffer->AddRef() from httpfsys.
>>
>> Overview:
>>   This unneeded pBuffer->AddRef() has been in httpfsys for several 
>> months. The memory leak has gone unnoticed until now, but the 
>> refcount bug also causes a crash in some circumstances when 
>> pBuffer->SetSize() is called later. (The implementation of 
>> CHXBuffer::SetSize bails out if the refcount is greater than 1 -- 
>> which is the case with the extra AddRef().)
>>
>> Files Modified:
>>   filesystem/http/httpfsys.cpp
>>
>> Index: httpfsys.cpp
>> ===================================================================
>> RCS file: /cvsroot/filesystem/http/httpfsys.cpp,v
>> retrieving revision 1.67
>> diff -u -w -c -2 -0 -r1.67 httpfsys.cpp
>> *** httpfsys.cpp        25 Jan 2005 01:09:48 -0000      1.67
>> --- httpfsys.cpp        26 Jan 2005 00:28:13 -0000
>> ***************
>> *** 4344,4360 ****
>>
>>       if (bShouldReadSocket)
>>       {
>>           IHXBuffer* pReadBuffer = NULL;
>>           retVal = m_pSocket->Read(&pReadBuffer);
>>
>>           if (HXR_OK == retVal)
>>           {
>> -             pReadBuffer->AddRef();
>>               m_PreProcessedReadBuffers.AddTail(pReadBuffer);
>>               HXLOGL4(HXLOG_HTTP, "Network: _DoSomeReadingFromSocket 
>> read %lu", pReadBuffer->GetSize());
>>           }
>>           else if (HXR_SOCK_ENDSTREAM == retVal)
>>           {
>>               // normal end of data reached
>>               if( m_pSocket )
>>               {
>>                   m_pSocket->Close();
>>
>>
>> _______________________________________________
>> Client-dev mailing list
>> Client-dev@helixcommunity.org
>> http://lists.helixcommunity.org/mailman/listinfo/client-dev
>
>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic