mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 22:05:40 +00:00
Fix 34491 - tree blocker. Double-free in http compress converter.
This commit is contained in:
parent
428084c741
commit
60817bcb13
@ -293,8 +293,14 @@ nsHTTPCompressConv::do_OnDataAvailable (nsIChannel *aChannel, nsISupports *aCont
|
||||
|
||||
nsCOMPtr<nsIByteArrayInputStream> convertedStreamSup;
|
||||
|
||||
rv = NS_NewByteArrayInputStream (getter_AddRefs(convertedStreamSup), buffer, aCount);
|
||||
if (NS_FAILED (rv))
|
||||
char * lBuf = (char *) nsAllocator::Alloc (aCount);
|
||||
if (lBuf == NULL)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
||||
memcpy (lBuf, buffer, aCount);
|
||||
|
||||
rv = NS_NewByteArrayInputStream (getter_AddRefs(convertedStreamSup), lBuf, aCount);
|
||||
if (NS_FAILED (rv))
|
||||
return rv;
|
||||
|
||||
nsCOMPtr<nsIInputStream> convertedStream = do_QueryInterface (convertedStreamSup, &rv);
|
||||
|
Loading…
x
Reference in New Issue
Block a user