From e677476aea95a0f1f50097b02c75510354c23296 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Fri, 2 Nov 2012 17:50:51 +0000 Subject: [PATCH] pmap: remove memory leaks Signed-off-by: Sami Kerola --- pmap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pmap.c b/pmap.c index 742fcea9..375c1146 100644 --- a/pmap.c +++ b/pmap.c @@ -520,7 +520,7 @@ static int one_proc(proc_t * p) } } - + fclose(fp); if (!q_option) { if (x_option) { if (sizeof(KLONG) == 8) { @@ -593,7 +593,7 @@ static void range_arguments(char *optarg) int main(int argc, char **argv) { - unsigned *pidlist; + unsigned long *pidlist; unsigned count = 0; PROCTAB *PT; proc_t p; @@ -692,6 +692,7 @@ int main(int argc, char **argv) count--; } closeproc(PT); + free(pidlist); if (count) /* didn't find all processes asked for */