diff --git a/dom/security/SecFetch.cpp b/dom/security/SecFetch.cpp index 2399b44ae7..d0591ed9f8 100644 --- a/dom/security/SecFetch.cpp +++ b/dom/security/SecFetch.cpp @@ -118,11 +118,10 @@ bool IsSameOrigin(nsIHttpChannel* aHTTPChannel) { // let's further check all the hoops in the redirectChain to // ensure all involved redirects are same-origin - nsCOMPtr redirectPrincipal; - for (nsIPrincipal* principal : loadInfo->RedirectChain()) { + for (nsCOMPtr principal : loadInfo->RedirectChain()) { if (principal) { - rv = redirectPrincipal->IsSameOrigin(channelURI, isPrivateWin, - &isSameOrigin); + rv = principal->IsSameOrigin(channelURI, isPrivateWin, + &isSameOrigin); Unused << NS_WARN_IF(NS_FAILED(rv)); if (!isSameOrigin) { return false;