From 561b2052883ad8d3803e46dbef636e52695cce17 Mon Sep 17 00:00:00 2001 From: Makoto Kato Date: Wed, 10 Feb 2016 13:21:50 +0900 Subject: [PATCH] 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 --HG-- extra : rebase_source : 06921086d842f7f6cdbe40d5d78fd024c310811d --- widget/windows/nsClipboard.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widget/windows/nsClipboard.cpp b/widget/windows/nsClipboard.cpp index a98f384ba82a..3e5959b18763 100644 --- a/widget/windows/nsClipboard.cpp +++ b/widget/windows/nsClipboard.cpp @@ -836,7 +836,7 @@ nsClipboard :: FindURLFromLocalFile ( IDataObject* inDataObject, UINT inIndex, v 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;