summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-29 23:42:47 +0000
committeratwilson@chromium.org <atwilson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-29 23:42:47 +0000
commit4cbc71e9c6f1fec187e0f16de08a16ad3db71740 (patch)
tree336eaebeb19d24b6ffa24e3593504e06fa42a123
parent78202defa5a10cf23c768f6b0013cb1365051a3d (diff)
downloadchromium_src-4cbc71e9c6f1fec187e0f16de08a16ad3db71740.zip
chromium_src-4cbc71e9c6f1fec187e0f16de08a16ad3db71740.tar.gz
chromium_src-4cbc71e9c6f1fec187e0f16de08a16ad3db71740.tar.bz2
Fixed memory leak in WebMessagePortImpl::postMessage()
WebMessagePortImpl::postMessage() now frees the incoming WebMessagePortArray when it is done with it. TEST=none (existing tests suffice) BUG=22932 Review URL: http://codereview.chromium.org/342082 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37565 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/common/webmessageportchannel_impl.cc2
-rw-r--r--tools/valgrind/memcheck/suppressions.txt7
2 files changed, 2 insertions, 7 deletions
diff --git a/chrome/common/webmessageportchannel_impl.cc b/chrome/common/webmessageportchannel_impl.cc
index 17b4fb8..86e9a5d 100644
--- a/chrome/common/webmessageportchannel_impl.cc
+++ b/chrome/common/webmessageportchannel_impl.cc
@@ -86,6 +86,7 @@ void WebMessagePortChannelImpl::postMessage(
std::vector<int> message_port_ids(channels ? channels->size() : 0);
if (channels) {
+ // Extract the port IDs from the source array, then free it.
for (size_t i = 0; i < channels->size(); ++i) {
WebMessagePortChannelImpl* webchannel =
static_cast<WebMessagePortChannelImpl*>((*channels)[i]);
@@ -93,6 +94,7 @@ void WebMessagePortChannelImpl::postMessage(
webchannel->QueueMessages();
DCHECK(message_port_ids[i] != MSG_ROUTING_NONE);
}
+ delete channels;
}
IPC::Message* msg = new WorkerProcessHostMsg_PostMessage(
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt
index 34687b1..ba0a716 100644
--- a/tools/valgrind/memcheck/suppressions.txt
+++ b/tools/valgrind/memcheck/suppressions.txt
@@ -1060,13 +1060,6 @@
fun:_Z16DispatchToMethodI21ResourceMessageFilter*
}
{
- bug_22932
- Memcheck:Leak
- fun:_Znw*
- fun:_ZN7WebCore26PlatformMessagePortChannel19postMessageToRemoteEN3WTF10PassOwnPtrINS_18MessagePortChannel9EventDataEEE
- fun:_ZN7WebCore18MessagePortChannel19postMessageToRemoteEN3WTF10PassOwnPtrINS0_9EventDataEEE
-}
-{
bug_23104
Memcheck:Leak
fun:_Znw*