Fix leak in PromiseDeferredTimer
authorkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 May 2017 17:03:34 +0000 (17:03 +0000)
committerkeith_miller@apple.com <keith_miller@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 31 May 2017 17:03:34 +0000 (17:03 +0000)
commit383cf9c0940f973c5114783eaba7daf04e704981
tree223d62958ec6f7eaacbe1a5349f4830c801526ef
parent9e090d9f016b457a6c437968903097b5cb98070c
Fix leak in PromiseDeferredTimer
https://bugs.webkit.org/show_bug.cgi?id=172755

Reviewed by JF Bastien.

We were not properly freeing the list of dependencies if we were already tracking the promise before.
This is because addPendingPromise takes the list of dependencies as an rvalue-reference. In the case
where we were already tracking the promise we append the provided dependency list to the existing list.
Since we never bound or rvalue-ref to a non-temporary value we never destructed the Vector, leaking its
contents.

* runtime/PromiseDeferredTimer.cpp:
(JSC::PromiseDeferredTimer::addPendingPromise):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@217608 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/PromiseDeferredTimer.cpp