summaryrefslogtreecommitdiff
path: root/procmem
diff options
context:
space:
mode:
authorChih-Hung Hsieh <chh@google.com>2016-03-04 10:14:32 -0800
committerChih-Hung Hsieh <chh@google.com>2016-03-04 10:14:32 -0800
commita57463f20e867439c4ba112f70c8d35080b26635 (patch)
tree9e7f8aa2971b4079664e7660f9a0de953f8f14f5 /procmem
parent4e6f660ab0d58bd375deec17f36532254183d29d (diff)
downloadextras-a57463f20e867439c4ba112f70c8d35080b26635.tar.gz
Fix static analyzer warnings.
* Add missing free. * Remove unused local variable. BUG: 27120398 Change-Id: I84d32fcee5615a428bd1de6673a6f15036736998
Diffstat (limited to 'procmem')
-rw-r--r--procmem/procmem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/procmem/procmem.c b/procmem/procmem.c
index 28055d8e..17a72121 100644
--- a/procmem/procmem.c
+++ b/procmem/procmem.c
@@ -50,12 +50,12 @@ int main(int argc, char *argv[]) {
/* maps and such */
pm_map_t **maps; size_t num_maps;
- struct map_info **mis;
+ struct map_info **mis = NULL;
struct map_info *mi;
/* pagemap information */
uint64_t *pagemap; size_t num_pages;
- unsigned long address; uint64_t mapentry;
+ uint64_t mapentry;
uint64_t count, flags;
/* totals */
@@ -190,7 +190,6 @@ int main(int argc, char *argv[]) {
mi->shared_clean = mi->shared_dirty = mi->private_clean = mi->private_dirty = 0;
for (j = 0; j < num_pages; j++) {
- address = pm_map_start(mi->map) + j * ker->pagesize;
mapentry = pagemap[j];
if (PM_PAGEMAP_PRESENT(mapentry) && !PM_PAGEMAP_SWAPPED(mapentry)) {
@@ -298,6 +297,7 @@ int main(int argc, char *argv[]) {
);
}
+ free(mis);
return 0;
}