summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2009-12-28 03:10:47 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2009-12-28 03:10:47 +0100
commit5de5cbd1a1852aca1169deaa622dc900fdf064bc (patch)
tree0229be85d554486b7485aea8c47c1d79ae1e8f23
parent0f35a278a4723f38e7c7a80678fcd59e40451142 (diff)
Fix duplicate port deallocation on error
* proc/info.c (S_proc_register_version): Do not deallocate port `credential' when err != 0.
-rw-r--r--proc/host.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/proc/host.c b/proc/host.c
index 0bf292e2..2b3c4f3c 100644
--- a/proc/host.c
+++ b/proc/host.c
@@ -474,6 +474,7 @@ S_proc_register_version (pstruct_t server,
rebuild_uname ();
out:
- mach_port_deallocate (mach_task_self (), credential);
+ if (!err)
+ mach_port_deallocate (mach_task_self (), credential);
return err;
}