mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Fix for leak of nsByteArrayInputStream objects and associated buffers from nsHTTPChunkConv. r=scc
This commit is contained in:
parent
41c7c7ff5d
commit
68c3380b79
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user