commit | 3c97e6a7d95653d81a00cc1f2274270fc577ec0d | [log] [tgz] |
---|---|---|
author | George Burgess IV <gbiv@google.com> | Wed Jan 20 17:24:45 2021 -0800 |
committer | George Burgess IV <gbiv@google.com> | Wed Jan 20 17:27:08 2021 -0800 |
tree | 47cb2a3537dd52737620ccabb1d0ea07badce960 | |
parent | 0f4112a7608d5773e0eeb9bf072b184615e4da08 [diff] |
androidfw: use a vector instead of manually managing memory The static analyzer caught a memory leak in this code: > frameworks/base/libs/androidfw/ResourceTypes.cpp:1042:45: warning: Potential leak of memory pointed to by 'convBuffer' [clang-analyzer-unix.Malloc] We can use a `std::vector` to hold our fixed-size, heap-allocated array. This will manage its own buffer for us. Bug: None Test: TreeHugger Change-Id: Ib83bdbc0bc60304747676e924f2ff549840aa861