Bug 1204610 - Use a smart pointer in nsNullPrincipalURI. r=mrbkap
authorAndrew McCreight <continuation@gmail.com>
Mon, 14 Sep 2015 12:43:00 +0200
changeset 295818 eb338ca59783eaf9bb44e865ee7da3154582b62f
parent 295817 178892677bdbb6dc0a0b21c67e06bc44a6db99e6
child 295819 3d9840db7d35ec36cbc5a5d87979aac9fe4d7568
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1204610
milestone43.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 1204610 - Use a smart pointer in nsNullPrincipalURI. r=mrbkap
caps/nsNullPrincipalURI.cpp
--- a/caps/nsNullPrincipalURI.cpp
+++ b/caps/nsNullPrincipalURI.cpp
@@ -269,22 +269,21 @@ nsNullPrincipalURI::CloneIgnoringRef(nsI
   // CloneIgnoringRef() is the same as Clone().
   return Clone(_newURI);
 }
 
 NS_IMETHODIMP
 nsNullPrincipalURI::Equals(nsIURI *aOther, bool *_equals)
 {
   *_equals = false;
-  nsNullPrincipalURI *otherURI;
+  nsRefPtr<nsNullPrincipalURI> otherURI;
   nsresult rv = aOther->QueryInterface(kNullPrincipalURIImplementationCID,
-                                       (void **)&otherURI);
+                                       getter_AddRefs(otherURI));
   if (NS_SUCCEEDED(rv)) {
     *_equals = mPath == otherURI->mPath;
-    NS_RELEASE(otherURI);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsNullPrincipalURI::EqualsExceptRef(nsIURI *aOther, bool *_equals)
 {
   // GetRef/SetRef not supported by nsNullPrincipalURI, so