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

Commit 5b15ffc7 authored by Luis A. Lozano's avatar Luis A. Lozano Committed by android-build-merger
Browse files

Merge "Fix "use of memory after freed" warning." am: 3f5160ca am: db5075c9 am: 85d08b12

am: a85ce119

Change-Id: I7b1fbceedb5d8d2a07a61f6e90d88f9e2fb28492
parents 0092d6ca a85ce119
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -289,7 +289,15 @@ SimpleBestFitAllocator::SimpleBestFitAllocator(size_t size)
SimpleBestFitAllocator::~SimpleBestFitAllocator()
{
    while(!mList.isEmpty()) {
        delete mList.remove(mList.head());
        chunk_t* removed = mList.remove(mList.head());
#ifdef __clang_analyzer__
        // Clang static analyzer gets confused in this loop
        // and generates a false positive warning about accessing
        // memory that is already freed.
        // Add an "assert" to avoid the confusion.
        LOG_ALWAYS_FATAL_IF(mList.head() == removed);
#endif
        delete removed;
    }
}