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

Commit f4183a51 authored by Dmitri Plotnikov's avatar Dmitri Plotnikov
Browse files

Fix native memory leak in Uint64ArrayRW

Bug: 377547685
Test: adb shell dumpsys batterystats --usage; adb shell dumpsys -t 60 meminfo --unreachable `adb shell pidof system_server` | grep "unreachable allocations"
Flag: EXEMPT bugfix
Change-Id: I2287379427a8de732eda866dfcc3d4129dfb890d
parent 83535125
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -46,9 +46,12 @@ Uint64ArrayRW &Uint64ArrayRW::operator=(const Uint64Array &t) {
    }
    if (mSize != 0) {
        if (t.data() != nullptr) {
            if (mData == nullptr) {
                mData = new uint64_t[mSize];
            }
            memcpy(mData, t.data(), mSize * sizeof(uint64_t));
        } else {
            delete[] mData;
            mData = nullptr;
        }
    }