| commit | c76bc32d959eb6bb3f0d1b9d70eaf18ffcaf909d | [log] [tgz] |
|---|---|---|
| author | Chih-Hung Hsieh <chh@google.com> | Thu Dec 01 17:52:50 2022 -0800 |
| committer | Chih-Hung Hsieh <chh@google.com> | Fri Dec 02 12:38:41 2022 -0800 |
| tree | d3e368ef01810240f48c278395ae57991883dbe7 | |
| parent | fa4926a9de0309fe7ef25ff76beed45fcfa12f48 [diff] |
Fix "Attempt to delete released memory" warning.
EXPECT_NONFATAL_FAILURE(statement, ...) expands to
do {
... statement ...
} while (::testing::internal::AlwaysFalse());
Clang analyzer cannot see into AlwaysFalse(),
and gives a false warning assuming that the
do loop can be done twice.
Use a unique_ptr::reset to call delete,
because reset can be called multiple times..
Bug: 259999410
Test: make tidy-system-core-fastboot_subset
Change-Id: Ie536f76635dd55f4e47b80eed6498fd1193b88ee