diff options
author | Harry Cutts <hcutts@google.com> | 2023-02-24 14:37:15 +0000 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-02-24 22:41:41 +0000 |
commit | 3059225019e295de1138574a16c0102c6845fefb (patch) | |
tree | 90dd72d25841456115215a62cf52607d4fbb7d16 | |
parent | fc3404e59b6b8897a00db7589528a618d1e45350 (diff) | |
download | libchrome-gestures-3059225019e295de1138574a16c0102c6845fefb.tar.gz |
List: free allocated memory in DeleteAll
This fixes a memory leak from LookaheadFilterInterpreter, where the
pointers contained in the list were not being freed on destruction.
Since LookaheadFilterInterpreter is the only user of List (as opposed to
MemoryManagedList), make freeing the memory the default behaviour.
BUG=b:266848195
TEST=fuzzer with testcase from b/266848195; unit tests; regression tests
Change-Id: Ifd81635cad9cf2fd7119c2e87433a3aaa5ba5dac
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/gestures/+/4290136
Commit-Queue: Harry Cutts <hcutts@chromium.org>
Tested-by: Harry Cutts <hcutts@chromium.org>
Reviewed-by: Sean O'Brien <seobrien@chromium.org>
Code-Coverage: Sean O'Brien <seobrien@chromium.org>
-rw-r--r-- | include/list.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/list.h b/include/list.h index 8e401bf..d5d94c4 100644 --- a/include/list.h +++ b/include/list.h @@ -49,7 +49,7 @@ class List { virtual void DeleteAll() { while (!Empty()) - PopFront(); + delete PopFront(); } Elt* Head() const { return sentinel_.next_; } |