summaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2009-12-20 15:28:17 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2009-12-20 15:28:17 +0100
commit8451b436124bd7fdf9c907ebb24687dec10e12bf (patch)
treec865386f1d6104c45f7bd8ed63c7978703f4be00 /auth
parent913d709e15209b2c33fdf146b4ad9d59737ab6a3 (diff)
Fix port leak when directly calling MIG stubs
* auth/auth.c (S_auth_server_authenticate): Check result of auth_server_authenticate_reply stub. * init/init.c (S_msg_sig_post_untraced): Check result of msg_sig_post_untraced_reply (S_msg_sig_post): Check result of msg_sig_post_reply.
Diffstat (limited to 'auth')
-rw-r--r--auth/auth.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/auth/auth.c b/auth/auth.c
index 3c5fa861..fd7c018f 100644
--- a/auth/auth.c
+++ b/auth/auth.c
@@ -367,6 +367,7 @@ S_auth_server_authenticate (struct authhandle *serverauth,
{
struct pending *u;
struct authhandle *user;
+ error_t err;
if (! serverauth)
return EOPNOTSUPP;
@@ -399,7 +400,6 @@ S_auth_server_authenticate (struct authhandle *serverauth,
/* No pending user RPC for this port.
Create a pending server RPC record. */
struct pending s;
- error_t err;
err = hurd_ihash_add (&pending_servers, rendezvous, &s);
if (! err)
@@ -428,12 +428,16 @@ S_auth_server_authenticate (struct authhandle *serverauth,
/* Extract the ids. We must use a separate reply stub so
we can deref the user auth handle after the reply uses its
contents. */
- auth_server_authenticate_reply (reply, reply_type, 0,
- user->euids.ids, user->euids.num,
- user->auids.ids, user->auids.num,
- user->egids.ids, user->egids.num,
- user->agids.ids, user->agids.num);
+ err = auth_server_authenticate_reply (reply, reply_type, 0,
+ user->euids.ids, user->euids.num,
+ user->auids.ids, user->auids.num,
+ user->egids.ids, user->egids.num,
+ user->agids.ids, user->agids.num);
+
ports_port_deref (user);
+ if (err)
+ return err;
+
mach_port_deallocate (mach_task_self (), rendezvous);
return MIG_NO_REPLY;
}