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

Commit 1e1d71e2 authored by Mark Salyzyn's avatar Mark Salyzyn
Browse files

logd: LogStatistics leak

- uid = -1 in subtract operation to match add

(cherry pick from commit f48ea7c8)

Bug: 15986335
Change-Id: I7d0b85b5334c5264fd04309cb78e0c9aec0ad261
parent a0e53540
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -302,6 +302,10 @@ void LidStatistics::add(unsigned short size, uid_t uid, pid_t pid) {
}

void LidStatistics::subtract(unsigned short size, uid_t uid, pid_t pid) {
    if (uid == (uid_t) -1) { // init
        uid = (uid_t) AID_ROOT;
    }

    UidStatisticsCollection::iterator it;
    for (it = begin(); it != end(); ++it) {
        UidStatistics *u = *it;