mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-22 02:37:15 +00:00
systat(1): Plug memory leak
The procstat_getprocs() function call in procgetinfo() allocated a buffer but it was not freed properly.
This commit is contained in:
parent
63007e4611
commit
4594eb4548
|
@ -205,7 +205,7 @@ per_proc_swap_usage(struct kinfo_proc *kipp)
|
|||
} while (vmobj != 0);
|
||||
}
|
||||
}
|
||||
free(freep);
|
||||
procstat_freevmmap(prstat, freep);
|
||||
return (pages);
|
||||
}
|
||||
|
||||
|
@ -272,6 +272,7 @@ procgetinfo(void)
|
|||
}
|
||||
if (nproc > 1)
|
||||
qsort(pu, nproc, sizeof(*pu), proc_compar);
|
||||
procstat_freeprocs(prstat, kipp);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in a new issue