Bug 1247160 - Clipboard causes memory leak by internet shortcut. r?jimm draft
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Wed, 10 Feb 2016 13:21:50 +0900
changeset 329980 5f29c5551a18286dbefe01767c850441c312e090
parent 329801 2dfb45d74f42d2a0010696f5fd47c7a7da94cedb
child 514079 a1c018441791d87fc2c7bf4e7a842d836f3cb04c
push id10655
push userm_kato@ga2.so-net.ne.jp
push dateWed, 10 Feb 2016 04:32:38 +0000
reviewersjimm
bugs1247160
milestone47.0a1
Bug 1247160 - Clipboard causes memory leak by internet shortcut. r?jimm UTF8ToNewUnicode alloces new memory, so we don't need new alloc to convert to UTF-16 MozReview-Commit-ID: K7saM1xxNQ1
widget/windows/nsClipboard.cpp
--- a/widget/windows/nsClipboard.cpp
+++ b/widget/windows/nsClipboard.cpp
@@ -831,17 +831,17 @@ nsClipboard :: FindURLFromLocalFile ( ID
     }
 
     if ( IsInternetShortcut(filepath) ) {
       free(*outData);
       nsAutoCString url;
       ResolveShortcut( file, url );
       if ( !url.IsEmpty() ) {
         // convert it to unicode and pass it out
-        nsDependentString urlString(UTF8ToNewUnicode(url));
+        NS_ConvertUTF8toUTF16 urlString(url);
         // the internal mozilla URL format, text/x-moz-url, contains
         // URL\ntitle.  We can guess the title from the file's name.
         nsAutoString title;
         file->GetLeafName(title);
         // We rely on IsInternetShortcut check that file has a .url extension.
         title.SetLength(title.Length() - 4);
         if (title.IsEmpty())
           title = urlString;