summaryrefslogtreecommitdiff
path: root/memps.c
diff options
context:
space:
mode:
Diffstat (limited to 'memps.c')
-rw-r--r--memps.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/memps.c b/memps.c
index 12f4017..b56ff3a 100644
--- a/memps.c
+++ b/memps.c
@@ -1117,7 +1117,6 @@ static int show_map_all_new(int output_type, char *output_path)
DIR *pDir = NULL;
struct dirent *curdir;
unsigned int pid;
- mapinfo *milist;
geminfo *glist;
geminfo *gpu_glist;
unsigned total_pss = 0;
@@ -1184,6 +1183,8 @@ static int show_map_all_new(int output_type, char *output_path)
errno = 0;
while ((curdir = readdir(pDir)) != NULL && !errno) {
+ mapinfo *milist;
+
pid = atoi(curdir->d_name);
if (pid < 1 || pid > pid_max || pid == getpid())
continue;
@@ -1195,7 +1196,7 @@ static int show_map_all_new(int output_type, char *output_path)
if (milist == 0)
continue;
- /* get classified map info */
+ /* get classified map info, milist will be freed */
get_trib_mapinfo(pid, milist, glist, gpu_glist, &tmi);
oom_score_adj = get_oomscoreadj(pid, oom_path);