summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2014-09-22 10:58:36 -0700
committerMark Salyzyn <salyzyn@google.com>2014-10-06 22:43:56 +0000
commitf48ea7c8dcfbf2220ececccb1f4fb2f42df9048c (patch)
treec5589572e8c8426c1ae9ff4ce38acabccce4ca0a
parentdf5aa61f05ccbef441cf8b024d4bbc1b717451f9 (diff)
downloadsystem_core-f48ea7c8dcfbf2220ececccb1f4fb2f42df9048c.zip
system_core-f48ea7c8dcfbf2220ececccb1f4fb2f42df9048c.tar.gz
system_core-f48ea7c8dcfbf2220ececccb1f4fb2f42df9048c.tar.bz2
logd: LogStatistics leak
- uid = -1 in subtract operation to match add Change-Id: I7d0b85b5334c5264fd04309cb78e0c9aec0ad261
-rw-r--r--logd/LogStatistics.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/logd/LogStatistics.cpp b/logd/LogStatistics.cpp
index 1305b0a..6f3a088 100644
--- a/logd/LogStatistics.cpp
+++ b/logd/LogStatistics.cpp
@@ -307,6 +307,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;