commit | 99fe0c17355d54924c6696c415b718f3a21422f5 | [log] [tgz] |
---|---|---|
author | Victor Costan <[email protected]> | Mon Oct 07 21:06:12 2019 |
committer | Commit Bot <[email protected]> | Mon Oct 07 21:06:12 2019 |
tree | e922f62c26a427bb2553b20fa35481563b9ce4cb | |
parent | 63a433fc59abbca3f6049b5d83e5d6bfa3a4529a [diff] |
WebSQL: Fix memory leak in SQLite VFS. The ownership model for SandboxedVfs and SandboxedVfsFile is explained in class comments. It is not straightforward (smart pointers) because SandboxedVfs is tied to sqlite3_vfs and SandboxedVfsFile is tied to sqlite3_file, which are under SQLite's control. The class comment state that SandboxedVfsFile is deleted when Close() is called, but the implementation did not do that. This CL fixes the inconsistency, plugging a small memory leak. Bug: 1010577, 1009234 Change-Id: I21c819b16e15868bebf6a1a06f1b8de776d100f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1843150 Commit-Queue: Joshua Bell <[email protected]> Auto-Submit: Victor Costan <[email protected]> Reviewed-by: Joshua Bell <[email protected]> Cr-Commit-Position: refs/heads/master@{#703462}
diff --git a/third_party/blink/renderer/modules/webdatabase/sqlite/sandboxed_vfs_file.cc b/third_party/blink/renderer/modules/webdatabase/sqlite/sandboxed_vfs_file.cc index 2762ed8..afc4438 100644 --- a/third_party/blink/renderer/modules/webdatabase/sqlite/sandboxed_vfs_file.cc +++ b/third_party/blink/renderer/modules/webdatabase/sqlite/sandboxed_vfs_file.cc
@@ -146,6 +146,7 @@ int SandboxedVfsFile::Close() { file_.Close(); + delete this; return SQLITE_OK; }