From afb685b3b07c7dd8836c8bf7dcff1da6a0d6204a Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Wed, 27 Jun 2001 11:31:06 +0000 Subject: 2001-06-27 Marcus Brinkmann * info.c (S_proc_getprocinfo): If we return because mmap failed for *PIARRAY, be sure to munmap THDS if necessary. --- proc/ChangeLog | 5 +++++ proc/info.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/proc/ChangeLog b/proc/ChangeLog index b41a25e9..79d1861e 100644 --- a/proc/ChangeLog +++ b/proc/ChangeLog @@ -1,3 +1,8 @@ +2001-06-27 Marcus Brinkmann + + * info.c (S_proc_getprocinfo): If we return because mmap failed + for *PIARRAY, be sure to munmap THDS if necessary. + 2001-05-12 Marcus Brinkmann * host.c (initialize_version_info): Clear last byte of KV to make 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); -- cgit v1.2.3