diff --git a/layout/base/src/nsPluginViewer.cpp b/layout/base/src/nsPluginViewer.cpp index 2bc35e7c149..045a937bc75 100644 --- a/layout/base/src/nsPluginViewer.cpp +++ b/layout/base/src/nsPluginViewer.cpp @@ -620,14 +620,17 @@ PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType) return rv; } rv = mViewer->StartLoad(channel, mNextStream); - NS_RELEASE(channel); - if (NS_FAILED(rv)) return rv; + + if (NS_FAILED(rv)) + { + NS_RELEASE(channel); + return rv; + } #else mViewer->StartLoad(aURL, contentType, mNextStream); #endif - if (nsnull == mNextStream) { + if (nsnull == mNextStream) return NS_ERROR_FAILURE; - } #ifdef NECKO return mNextStream->OnStartRequest(channel, ctxt); #else diff --git a/modules/plugin/base/src/nsPluginViewer.cpp b/modules/plugin/base/src/nsPluginViewer.cpp index 2bc35e7c149..045a937bc75 100644 --- a/modules/plugin/base/src/nsPluginViewer.cpp +++ b/modules/plugin/base/src/nsPluginViewer.cpp @@ -620,14 +620,17 @@ PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType) return rv; } rv = mViewer->StartLoad(channel, mNextStream); - NS_RELEASE(channel); - if (NS_FAILED(rv)) return rv; + + if (NS_FAILED(rv)) + { + NS_RELEASE(channel); + return rv; + } #else mViewer->StartLoad(aURL, contentType, mNextStream); #endif - if (nsnull == mNextStream) { + if (nsnull == mNextStream) return NS_ERROR_FAILURE; - } #ifdef NECKO return mNextStream->OnStartRequest(channel, ctxt); #else diff --git a/modules/plugin/nglsrc/nsPluginViewer.cpp b/modules/plugin/nglsrc/nsPluginViewer.cpp index 2bc35e7c149..045a937bc75 100644 --- a/modules/plugin/nglsrc/nsPluginViewer.cpp +++ b/modules/plugin/nglsrc/nsPluginViewer.cpp @@ -620,14 +620,17 @@ PluginListener::OnStartRequest(nsIURI* aURL, const char *contentType) return rv; } rv = mViewer->StartLoad(channel, mNextStream); - NS_RELEASE(channel); - if (NS_FAILED(rv)) return rv; + + if (NS_FAILED(rv)) + { + NS_RELEASE(channel); + return rv; + } #else mViewer->StartLoad(aURL, contentType, mNextStream); #endif - if (nsnull == mNextStream) { + if (nsnull == mNextStream) return NS_ERROR_FAILURE; - } #ifdef NECKO return mNextStream->OnStartRequest(channel, ctxt); #else