Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e3a7d65a authored by George Burgess IV's avatar George Burgess IV Committed by android-build-merger
Browse files

Merge "Silence static analyzer warnings about memory leaks" am: 20ae530e am:...

Merge "Silence static analyzer warnings about memory leaks" am: 20ae530e am: 07406662 am: 64b6ce0d
am: fd60591e

Change-Id: Ie81cd1ae224e33b4c2a1e09b567cc6ba99c98643
parents e6a4bf7c fd60591e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -27,6 +27,9 @@ namespace android {

class HiddenPointer {
 public:
  // Since we're doing such a good job of hiding it, the static analyzer
  // thinks that we're leaking this `malloc`. This is probably related to
  // https://bugs.llvm.org/show_bug.cgi?id=34198. NOLINTNEXTLINE
  explicit HiddenPointer(size_t size = 256) { Set(malloc(size)); }
  ~HiddenPointer() { Free(); }
  void* Get() { return reinterpret_cast<void*>(~ptr_); }