mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +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);
|
} while (vmobj != 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(freep);
|
procstat_freevmmap(prstat, freep);
|
||||||
return (pages);
|
return (pages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,6 +272,7 @@ procgetinfo(void)
|
||||||
}
|
}
|
||||||
if (nproc > 1)
|
if (nproc > 1)
|
||||||
qsort(pu, nproc, sizeof(*pu), proc_compar);
|
qsort(pu, nproc, sizeof(*pu), proc_compar);
|
||||||
|
procstat_freeprocs(prstat, kipp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue