summaryrefslogtreecommitdiff
path: root/proc/info.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2001-06-27 11:31:06 +0000
committerMarcus Brinkmann <marcus@gnu.org>2001-06-27 11:31:06 +0000
commitafb685b3b07c7dd8836c8bf7dcff1da6a0d6204a (patch)
treeed1baee6e6c1f2271d4fd57a20615b8ad315bdfd /proc/info.c
parent7cde3c6542501a2e36b780408429a4e30588c87b (diff)
2001-06-27 Marcus Brinkmann <marcus@gnu.org>
* info.c (S_proc_getprocinfo): If we return because mmap failed for *PIARRAY, be sure to munmap THDS if necessary.
Diffstat (limited to 'proc/info.c')
-rw-r--r--proc/info.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/proc/info.c b/proc/info.c
index 01f01036..580ce8fb 100644
--- a/proc/info.c
+++ b/proc/info.c
@@ -409,7 +409,12 @@ S_proc_getprocinfo (struct proc *callerp,
{
*piarray = mmap (0, structsize, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
if (*piarray == MAP_FAILED)
- return errno;
+ {
+ err = errno;
+ if (*flags & PI_FETCH_THREADS)
+ munmap (thds, nthreads * sizeof (thread_t));
+ return err;
+ }
pi_alloced = 1;
}
*piarraylen = structsize / sizeof (int);