From 5273f998d458ae871995dafd68854c7bbbb0e4ef Mon Sep 17 00:00:00 2001 From: rpotts Date: Fri, 3 Jul 1998 06:15:06 +0000 Subject: [PATCH] Cause the netlib load to fail if OnStartBinding(...) returns an error. git-svn-id: svn://10.0.0.236/trunk@4989 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/network/module/nsStubContext.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/mozilla/network/module/nsStubContext.cpp b/mozilla/network/module/nsStubContext.cpp index fb51d1c5a23..b7d60e0d368 100644 --- a/mozilla/network/module/nsStubContext.cpp +++ b/mozilla/network/module/nsStubContext.cpp @@ -482,7 +482,23 @@ NET_StreamBuilder (FO_Present_Types format_out, printf("+++ Created a stream for %s\n", URL_s->address); #endif if (pConn->pConsumer) { - pConn->pConsumer->OnStartBinding(URL_s->content_type); + nsresult rv; + + rv = pConn->pConsumer->OnStartBinding(URL_s->content_type); + /* + * If OnStartBinding fails, then tear down the NET_StreamClass + * and release all references... + */ + if (NS_OK != rv) { + NET_DropURLStruct(URL_s); + free(stream); + stream = NULL; + + /* + * The NET_GetURL(...) exit_routine will clean up the + * nsConnectionInfo and associated objects. + */ + } } } }