From 5d5432d2685830defc60e33a3458b3b5dba32338 Mon Sep 17 00:00:00 2001 From: "hpradhan%hotpop.com" Date: Thu, 4 Mar 2004 08:13:09 +0000 Subject: [PATCH] bug 236351 : Fix string leak in nsSOAPCall::GetTransport() r+sr=jst --- extensions/webservices/soap/src/nsSOAPCall.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/extensions/webservices/soap/src/nsSOAPCall.cpp b/extensions/webservices/soap/src/nsSOAPCall.cpp index a4f64be20ba1..21d4ae79c854 100644 --- a/extensions/webservices/soap/src/nsSOAPCall.cpp +++ b/extensions/webservices/soap/src/nsSOAPCall.cpp @@ -97,30 +97,23 @@ NS_IMETHODIMP nsSOAPCall::SetTransportURI(const nsAString & aTransportURI) nsresult nsSOAPCall::GetTransport(nsISOAPTransport ** aTransport) { NS_ENSURE_ARG_POINTER(aTransport); + *aTransport = nsnull; + nsresult rv; nsCOMPtr < nsIURI > uri; - nsCAutoString protocol; - nsCString transportURI(ToNewCString(mTransportURI)); - rv = NS_NewURI(getter_AddRefs(uri), transportURI.get()); + rv = NS_NewURI(getter_AddRefs(uri), mTransportURI); if (NS_FAILED(rv)) return rv; + nsCAutoString protocol; uri->GetScheme(protocol); nsCAutoString transportContractid; transportContractid.Assign(NS_SOAPTRANSPORT_CONTRACTID_PREFIX); transportContractid.Append(protocol); - nsCOMPtr < nsISOAPTransport > transport = - do_GetService(transportContractid.get(), &rv); - if (NS_FAILED(rv)) - return rv; - - *aTransport = transport.get(); - NS_ADDREF(*aTransport); - - return NS_OK; + return CallGetService(transportContractid.get(), aTransport); } /* nsISOAPResponse invoke (); */