Bug 1310453 - Check whether aUri isn't created. r=jimm, a=ritu
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Mon, 17 Oct 2016 12:17:42 +0900
changeset 340661 bcca478fadc01e2f47d38675de8555cb1ced584d
parent 340660 a0c8270776dfadbc9c946c0c75bd947f8fb75a95
child 340662 87189846bebf199717cdd5815f27063fd3d1d64f
push id10172
push usercbook@mozilla.com
push dateThu, 20 Oct 2016 13:28:22 +0000
treeherdermozilla-aurora@bcca478fadc0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, ritu
bugs1310453
milestone51.0a2
Bug 1310453 - Check whether aUri isn't created. r=jimm, a=ritu Since aUri is nullptr, Firefox will crash on shutdown. MozReview-Commit-ID: E5ENWsjK7Px
widget/windows/nsDataObj.cpp
--- a/widget/windows/nsDataObj.cpp
+++ b/widget/windows/nsDataObj.cpp
@@ -1127,19 +1127,21 @@ HRESULT
 nsDataObj :: GetFileContentsInternetShortcut ( FORMATETC& aFE, STGMEDIUM& aSTG )
 {
   static const char * kShellIconPref = "browser.shell.shortcutFavicons";
   nsAutoString url;
   if ( NS_FAILED(ExtractShortcutURL(url)) )
     return E_OUTOFMEMORY;
 
   nsCOMPtr<nsIURI> aUri;
-  NS_NewURI(getter_AddRefs(aUri), url);
+  nsresult rv = NS_NewURI(getter_AddRefs(aUri), url);
+  if (NS_FAILED(rv)) {
+    return E_FAIL;
+  }
 
-  nsresult rv;
   nsAutoCString asciiUrl;
   rv = aUri->GetAsciiSpec(asciiUrl);
   if (NS_FAILED(rv)) {
     return E_FAIL;
   }
 
   const char *shortcutFormatStr;
   int totalLen;