diff options
| author | 2022-10-06 15:55:34 -0700 | |
|---|---|---|
| committer | 2022-10-06 15:56:19 -0700 | |
| commit | 079077fd7707ff51243fc76e98adbc92bdd9f992 (patch) | |
| tree | a831bb4c4af31ea8243d62d5273f8b7dfd13ac83 /libs/androidfw/StringPool.cpp | |
| parent | 72154d309d4af6934121640b523816e14d0ceff4 (diff) | |
CursorWindow_test: fix leaks
`buf` isn't freed here. Convert it to either a unique_ptr or stack
array, depending on size.
Caught by the static analyzer:
> frameworks/base/libs/androidfw/tests/CursorWindow_test.cpp:190:5:
warning: Potential leak of memory pointed to by 'buf'
[clang-analyzer-unix.Malloc]
> frameworks/base/libs/androidfw/tests/CursorWindow_test.cpp:268:5:
warning: Potential leak of memory pointed to by 'buf'
[clang-analyzer-unix.Malloc]
> frameworks/base/libs/androidfw/tests/CursorWindow_test.cpp:327:5:
warning: Potential leak of memory pointed to by 'buf'
[clang-analyzer-unix.Malloc]
Bug: 206470603
Test: TreeHugger
Change-Id: I6fee4a9c2eedce0385f794567b0083df24c63419
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions