[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 16/98: libshouldbeinlibc: fix reference counting in port_name_xla
From: |
Samuel Thibault |
Subject: |
[hurd] 16/98: libshouldbeinlibc: fix reference counting in port_name_xlator_create |
Date: |
Tue, 14 Jan 2014 01:59:58 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 9b02c4454abee568af9ff1d6c9044e9cd757b5aa
Author: Justus Winter <address@hidden>
Date: Thu Nov 7 17:01:02 2013 +0100
libshouldbeinlibc: fix reference counting in port_name_xlator_create
Both task ports are deallocated in the destructor, so they must be
referenced in the constructor.
* libshouldbeinlibc/portxlate.c (port_name_xlator_create): Fix
reference counting.
---
libshouldbeinlibc/portxlate.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libshouldbeinlibc/portxlate.c b/libshouldbeinlibc/portxlate.c
index 599fb58..8888e2c 100644
--- a/libshouldbeinlibc/portxlate.c
+++ b/libshouldbeinlibc/portxlate.c
@@ -35,7 +35,9 @@ port_name_xlator_create (mach_port_t from_task, mach_port_t
to_task,
if (! x)
return ENOMEM;
+ mach_port_mod_refs (mach_task_self (), from_task, MACH_PORT_RIGHT_SEND, +1);
x->from_task = from_task;
+ mach_port_mod_refs (mach_task_self (), to_task, MACH_PORT_RIGHT_SEND, +1);
x->to_task = to_task;
x->to_names = 0;
x->to_types = 0;
@@ -64,6 +66,10 @@ port_name_xlator_create (mach_port_t from_task, mach_port_t
to_task,
x->to_names_len * sizeof (mach_port_t));
munmap ((caddr_t) x->to_types,
x->to_types_len * sizeof (mach_port_type_t));
+
+ mach_port_deallocate (mach_task_self (), x->to_task);
+ mach_port_deallocate (mach_task_self (), x->from_task);
+
err = ENOMEM;
}
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 91/98: trans/mtab: remove the loop detection logic, (continued)
- [hurd] 91/98: trans/mtab: remove the loop detection logic, Samuel Thibault, 2014/01/13
- [hurd] 97/98: libnetfs: register passive translator startups, Samuel Thibault, 2014/01/13
- [hurd] 19/98: libdiskfs: fix error handling, Samuel Thibault, 2014/01/13
- [hurd] 11/98: mach-defpager: turn dealloc_direct into a normal function, Samuel Thibault, 2014/01/13
- [hurd] 23/98: mach-defpager: do not remove -Wall from CFLAGS, Samuel Thibault, 2014/01/13
- [hurd] 94/98: trans/mtab: do not include non-filesystem translators by default, Samuel Thibault, 2014/01/13
- [hurd] 96/98: libdiskfs: register passive translator startups, Samuel Thibault, 2014/01/13
- [hurd] 92/98: trans/mtab: properly lock mtab objects, Samuel Thibault, 2014/01/13
- [hurd] 03/98: libports: fix the thread counts in case the thread creation fails, Samuel Thibault, 2014/01/13
- [hurd] 76/98: utils/settrans: fix the teardown of chrooted environments, Samuel Thibault, 2014/01/13
- [hurd] 16/98: libshouldbeinlibc: fix reference counting in port_name_xlator_create,
Samuel Thibault <=
- [hurd] 95/98: libfshelp: fix the api of fshelp_set_active_translator, Samuel Thibault, 2014/01/13
- [hurd] 98/98: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2014/01/13
- [hurd] 17/98: utils: implement portinfo --search, Samuel Thibault, 2014/01/13
- [hurd] 10/98: auth: fix use of uninitialized variable err, Samuel Thibault, 2014/01/13
- [hurd] 61/98: trans: fix transparent reauthentication in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 01/98: pfinet: fix emission on the loopback device, Samuel Thibault, 2014/01/13
- [hurd] 63/98: libfshelp: use a hash table in get-identity.c, Samuel Thibault, 2014/01/13
- [hurd] 90/98: trans/mtab: populate mtab objects on demand, Samuel Thibault, 2014/01/13
- [hurd] 09/98: init: fix memory leak, Samuel Thibault, 2014/01/13
- [hurd] 88/98: libports: remove the threadvars stack size hack, Samuel Thibault, 2014/01/13