mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 14:52:16 +00:00
110366 r/sr=darin, addref the reader before using it so that it doesn't get released from under us.
This commit is contained in:
parent
9e63240a5d
commit
f92d740c9c
@ -364,6 +364,7 @@ nsStorageTransport::AsyncRead(nsIStreamListener *aListener,
|
||||
NS_NEWXPCOM(reader, nsReadRequest);
|
||||
if (!reader)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
NS_ADDREF(reader);
|
||||
|
||||
reader->SetTransport(this);
|
||||
reader->SetTransferOffset(aOffset);
|
||||
@ -376,14 +377,14 @@ nsStorageTransport::AsyncRead(nsIStreamListener *aListener,
|
||||
rv = reader->SetListener(aListener, aContext);
|
||||
if (NS_FAILED(rv)) goto error;
|
||||
|
||||
rv = reader->Process();
|
||||
if (NS_FAILED(rv)) goto error;
|
||||
|
||||
NS_ADDREF(*aRequest = reader);
|
||||
rv = reader->Process();
|
||||
if (NS_FAILED(rv)) goto error;
|
||||
|
||||
*aRequest = reader;
|
||||
return NS_OK;
|
||||
|
||||
error:
|
||||
NS_DELETEXPCOM(reader);
|
||||
NS_RELEASE(reader);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user