Bug 604629 - nsClipboard::SetNativeClipboardData leaks primitive_data. r+a=dougt
authortimeless@mozdev.org
Mon, 18 Oct 2010 11:25:41 +0200
changeset 55993 cfd18201f49be4aa725b832b413dee7afaf6d4cf
parent 55992 4056867a34ac368ed9d2ec8f5f9d7d2bde81cf36
child 55994 249a1313aa5289d5ce3f798e4d6ed9d149954e85
push id16363
push userdgottwald@mozilla.com
push dateMon, 18 Oct 2010 09:26:09 +0000
treeherdermozilla-central@cfd18201f49b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs604629
milestone2.0b8pre
first release with
nightly linux32
cfd18201f49b / 4.0b8pre / 20101018030619 / files
nightly linux64
cfd18201f49b / 4.0b8pre / 20101018031115 / files
nightly mac
cfd18201f49b / 4.0b8pre / 20101018030443 / files
nightly win32
cfd18201f49b / 4.0b8pre / 20101018043251 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 604629 - nsClipboard::SetNativeClipboardData leaks primitive_data. r+a=dougt
widget/src/qt/nsClipboard.cpp
--- a/widget/src/qt/nsClipboard.cpp
+++ b/widget/src/qt/nsClipboard.cpp
@@ -237,16 +237,17 @@ nsClipboard::SetNativeClipboardData( nsI
                 nsPrimitiveHelpers::CreateDataFromPrimitive(flavorStr.get(), clip,
                                                             &primitive_data, len);
 
                 if (primitive_data)
                 {
                     QByteArray data ((const char *)primitive_data, len);
                     // Add data to the mimeData
                     mimeData->setData(flavorStr.get(), data);
+                    nsMemory::Free(primitive_data);
                 }
             }
         }
     }
 
     // If we have some mime data, add it to the clipboard
     if(!mimeData->formats().isEmpty())
         cb->setMimeData(mimeData, clipboardMode);