Bug 679196 - Mem leak when preferred effect is set for drag and drop; r=neil
authorBrian R. Bondy <netzen@gmail.com>
Mon, 12 Sep 2011 17:52:37 -0400
changeset 77940 3f3380cfd15a583ed60b6039942ae1fcdaeecfc8
parent 77939 d3af41c6bf0b13cdc08e1de33399557963782c87
child 77941 b8d354d37128bdbbd7e3f781c914dd45b0e71a3d
push id340
push userclegnitto@mozilla.com
push dateTue, 08 Nov 2011 22:56:33 +0000
treeherdermozilla-beta@f745dc151615 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil
bugs679196
milestone9.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 679196 - Mem leak when preferred effect is set for drag and drop; r=neil
widget/src/windows/nsNativeDragTarget.cpp
--- a/widget/src/windows/nsNativeDragTarget.cpp
+++ b/widget/src/windows/nsNativeDragTarget.cpp
@@ -275,16 +275,18 @@ nsNativeDragTarget::DragEnter(LPDATAOBJE
   nsresult loadResult = nsClipboard::GetNativeDataOffClipboard(
       pIDataSource, 0, ::RegisterClipboardFormat(CFSTR_PREFERREDDROPEFFECT), nsnull, &tempOutData, &tempDataLen);
   if (NS_SUCCEEDED(loadResult) && tempOutData) {
     NS_ASSERTION(tempDataLen == 2, "Expected word size");
     WORD preferredEffect = *((WORD*)tempOutData);
 
     // Mask effect coming from function call with effect preferred by the source.
     mMovePreferred = (preferredEffect & DROPEFFECT_MOVE) != 0;
+
+    nsMemory::Free(tempOutData);
   } else {
     mMovePreferred = PR_FALSE;
   }
 
   // Set the native data object into drag service
   //
   // This cast is ok because in the constructor we created a
   // the actual implementation we wanted, so we know this is