Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoltan Varga <vargaz@gmail.com>2014-08-15 17:56:47 +0400
committerSebastien Pouliot <sebastien@xamarin.com>2014-08-15 18:19:13 +0400
commit45d0ba1bc0b1e8740622b6c6468dfdba45c1d7fd (patch)
tree0b6ef848647e9ba609d80eb37796b1e8826fada1
parent69104ca6c7093cc482ad5b09b01c64601d46d742 (diff)
[runtime] Fix the leaking of mach ports introduced by 98bbf8512aec0fa01b4426583280f6d231d22187. Fixes #22068.mono-3.8.0.9mono-3.8.0
-rw-r--r--mono/utils/mono-proclib.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mono/utils/mono-proclib.c b/mono/utils/mono-proclib.c
index 279db86d96d..3f032f9d22c 100644
--- a/mono/utils/mono-proclib.c
+++ b/mono/utils/mono-proclib.c
@@ -417,7 +417,8 @@ get_pid_status_item (int pid, const char *item, MonoProcessError *error, int mul
}
if (task_info (task, TASK_BASIC_INFO, (task_info_t)&t_info, &th_count) != KERN_SUCCESS) {
- mach_port_deallocate (mach_task_self (), task);
+ if (pid != getpid ())
+ mach_port_deallocate (mach_task_self (), task);
RET_ERROR (MONO_PROCESS_ERROR_OTHER);
}
@@ -430,7 +431,8 @@ get_pid_status_item (int pid, const char *item, MonoProcessError *error, int mul
else
ret = 0;
- mach_port_deallocate (mach_task_self (), task);
+ if (pid != getpid ())
+ mach_port_deallocate (mach_task_self (), task);
return ret;
#else