Fix for leak of nsByteArrayInputStream objects and associated buffers from nsHTTPChunkConv. r=scc

This commit is contained in:
bruce%cybersight.com 2000-04-04 04:35:25 +00:00
parent 41c7c7ff5d
commit 68c3380b79

View File

@ -181,17 +181,14 @@ nsHTTPChunkConv::OnDataAvailable (
{
if (mChunkBufferLength > 0)
{
nsIInputStream * convertedStream = nsnull;
nsIByteArrayInputStream * convertedStreamSup = nsnull;
rv = NS_NewByteArrayInputStream (&convertedStreamSup, mChunkBuffer, mChunkBufferLength);
nsCOMPtr<nsIByteArrayInputStream> convertedStreamSup;
rv = NS_NewByteArrayInputStream (getter_AddRefs(convertedStreamSup), mChunkBuffer, mChunkBufferLength);
if (NS_FAILED (rv))
return rv;
mChunkBuffer = NULL;
rv = convertedStreamSup -> QueryInterface (NS_GET_IID (nsIInputStream), (void**)&convertedStream);
NS_RELEASE (convertedStreamSup);
nsCOMPtr<nsIInputStream> convertedStream = do_QueryInterface (convertedStreamSup, &rv);
if (NS_FAILED (rv))
return rv;