Bug 1269475 - Fix uninitialized variable warning. r=jdm
authorRalph Giles <giles@mozilla.com>
Mon, 02 May 2016 13:30:36 -0700
changeset 295763 623941e6df489758f9b75317544bb122d260f2ce
parent 295762 5d2a22f7aa3963f33c0f551f48e26cee99e0fa93
child 295764 d0fc972a906aeddbde6f432dff671fbad869feb6
push id76070
push userrgiles@mozilla.com
push dateMon, 02 May 2016 23:47:49 +0000
treeherdermozilla-inbound@623941e6df48 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs1269475
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1269475 - Fix uninitialized variable warning. r=jdm Initialize rv at declaration to handle the !hrefURI case. MozReview-Commit-ID: 65tEvO4hNEA
dom/html/nsHTMLDNSPrefetch.cpp
--- a/dom/html/nsHTMLDNSPrefetch.cpp
+++ b/dom/html/nsHTMLDNSPrefetch.cpp
@@ -315,17 +315,17 @@ nsHTMLDNSPrefetch::nsDeferrals::SubmitQu
   while (mHead != mTail) {
     nsCOMPtr<nsIContent> content = do_QueryReferent(mEntries[mTail].mElement);
     if (content) {
       nsCOMPtr<Link> link = do_QueryInterface(content);
       // Only prefetch here if request was deferred and deferral not cancelled
       if (link && link->HasDeferredDNSPrefetchRequest()) {
         nsCOMPtr<nsIURI> hrefURI(link ? link->GetURI() : nullptr);
         bool isLocalResource = false;
-        nsresult rv;
+        nsresult rv = NS_OK;
 
         hostName.Truncate();
         if (hrefURI) {
           hrefURI->GetAsciiHost(hostName);
           rv = NS_URIChainHasFlags(hrefURI,
                                    nsIProtocolHandler::URI_IS_LOCAL_RESOURCE,
                                    &isLocalResource);
         }