From be0a6194eeda122314f55e10f167a5131de6a0f5 Mon Sep 17 00:00:00 2001 From: "gagan%netscape.com" Date: Tue, 16 Mar 1999 07:46:57 +0000 Subject: [PATCH] Fix for 3776. --- network/module/nsHttpUrl.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/network/module/nsHttpUrl.cpp b/network/module/nsHttpUrl.cpp index f3952ee32dd8..bac3d194fbd7 100644 --- a/network/module/nsHttpUrl.cpp +++ b/network/module/nsHttpUrl.cpp @@ -667,19 +667,20 @@ nsHttpUrlImpl::ReconstructSpec(void) PRBool nsHttpUrlImpl::Equals(const nsIURL* aURL) const { - PRBool bIsEqual; - NS_LOCK_INSTANCE(); - nsIHttpURL* otherURL; - if (NS_SUCCEEDED(((nsIURL*)aURL)->QueryInterface(kIHttpURLIID, (void**)&otherURL))) { - nsHttpUrlImpl* other = (nsHttpUrlImpl*)otherURL; - bIsEqual = PRBool((0 == PL_strcmp(mProtocol, other->mProtocol)) && - (0 == PL_strcasecmp(mHost, other->mHost)) && - (0 == PL_strcmp(mFile, other->mFile))); - NS_RELEASE(otherURL); + PRBool bIsEqual(PR_FALSE); + if (aURL) + { + NS_LOCK_INSTANCE(); + nsIHttpURL* otherURL; + if (NS_SUCCEEDED(((nsIURL*)aURL)->QueryInterface(kIHttpURLIID, (void**)&otherURL))) { + nsHttpUrlImpl* other = (nsHttpUrlImpl*)otherURL; + bIsEqual = PRBool((0 == PL_strcmp(mProtocol, other->mProtocol)) && + (0 == PL_strcasecmp(mHost, other->mHost)) && + (0 == PL_strcmp(mFile, other->mFile))); + NS_RELEASE(otherURL); + } + NS_UNLOCK_INSTANCE(); } - else - bIsEqual = PR_FALSE; - NS_UNLOCK_INSTANCE(); return bIsEqual; }