Bug 357877 nsFileChannel::OpenContentStream leaks when

nsFileUploadContentStream::IsInitialized fails
patch by Ryan Jones <sciguyryan+bugzilla@gmail.com> r+sr=biesi


git-svn-id: svn://10.0.0.236/trunk@214110 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cbiesinger%web.de
2006-10-25 16:00:02 +00:00
parent 953e34a25d
commit 2787833bb7

View File

@@ -49,6 +49,7 @@
#include "nsNetSegmentUtils.h"
#include "nsProxyRelease.h"
#include "nsAutoPtr.h"
#include "nsStandardURL.h"
#include "nsIFileURL.h"
#include "nsIMIMEService.h"
@@ -332,8 +333,10 @@ nsFileChannel::OpenContentStream(PRBool async, nsIInputStream **result)
nsFileUploadContentStream *uploadStream =
new nsFileUploadContentStream(async, fileStream, mUploadStream,
mUploadLength, this);
if (!uploadStream || !uploadStream->IsInitialized())
if (!uploadStream || !uploadStream->IsInitialized()) {
delete uploadStream;
return NS_ERROR_OUT_OF_MEMORY;
}
stream = uploadStream;
SetContentLength64(0);