commit | 8efe21a30f66aaabfe40642ba8474e6f86cc6ab8 | [log] [tgz] |
---|---|---|
author | George Burgess IV <gbiv@google.com> | Wed Dec 05 16:40:40 2018 -0800 |
committer | George Burgess IV <gbiv@google.com> | Wed Dec 05 17:32:35 2018 -0800 |
tree | beab3891692f64d700a79ef80f0c99786d655d03 | |
parent | 3271ffae30a808e9cedce70729b4ebf42b0afc17 [diff] |
Fix a potential memory leak Our analyzer spotted a potential memory leak here: if GetFields() is zero length, we'll leak our freshly-allocated `sizeCheck`: system/tools/aidl/generate_java.cpp:215:3: warning: Potential leak of memory pointed to by 'sizeCheck' [clang-analyzer-cplusplus.NewDeleteLeaks] `new`ing it up lazily makes the leak go away. Bug: None Test: Ran the analyzer; memory leak warning is gone. Change-Id: Iafbacbf5c2da1a41bc9d83f6d91fdfefed9dc27a