[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 20/23: Drop duplicate port deallocation
From: |
Samuel Thibault |
Subject: |
[hurd] 20/23: Drop duplicate port deallocation |
Date: |
Tue, 13 Oct 2015 00:09:56 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit bd7e7ae44c78bcfe623dec8636375685c8c30be3
Author: Samuel Thibault <address@hidden>
Date: Sun Oct 11 22:02:41 2015 +0200
Drop duplicate port deallocation
Follow-up dbfa8a3
* libnetfs/io-reauthenticate.c (netfs_S_io_reauthenticate): Do not
deallocate parameter port `rend_port' when an error will be returned.
* libtrivfs/io-reauthenticate.c (trivfs_S_io_reauthenticate): Do not
deallocate parameter port `rend_port' when an error will be returned.
---
libnetfs/io-reauthenticate.c | 3 ++-
libtrivfs/io-reauthenticate.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/libnetfs/io-reauthenticate.c b/libnetfs/io-reauthenticate.c
index f4f50d5..9192813 100644
--- a/libnetfs/io-reauthenticate.c
+++ b/libnetfs/io-reauthenticate.c
@@ -43,7 +43,8 @@ netfs_S_io_reauthenticate (struct protid *user, mach_port_t
rend_port)
newright, 1);
pthread_mutex_lock (&user->po->np->lock);
- mach_port_deallocate (mach_task_self (), rend_port);
+ if (!err)
+ mach_port_deallocate (mach_task_self (), rend_port);
mach_port_deallocate (mach_task_self (), newright);
mach_port_move_member (mach_task_self (), newpi->pi.port_right,
diff --git a/libtrivfs/io-reauthenticate.c b/libtrivfs/io-reauthenticate.c
index c75f5fc..35775e5 100644
--- a/libtrivfs/io-reauthenticate.c
+++ b/libtrivfs/io-reauthenticate.c
@@ -52,7 +52,8 @@ trivfs_S_io_reauthenticate (struct trivfs_protid *cred,
assert (newright != MACH_PORT_NULL);
err = iohelp_reauth (&newcred->user, auth, rendport, newright, 1);
- mach_port_deallocate (mach_task_self (), rendport);
+ if (!err)
+ mach_port_deallocate (mach_task_self (), rendport);
mach_port_deallocate (mach_task_self (), auth);
if (err)
return err;
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (3f883d3 -> b989189), Samuel Thibault, 2015/10/12
- [hurd] 18/23: Update NEWS file, Samuel Thibault, 2015/10/12
- [hurd] 15/23: libtrivfs: deprecate old api, Samuel Thibault, 2015/10/12
- [hurd] 19/23: Add missing null checks in libshouldbeinlibc, Samuel Thibault, 2015/10/12
- [hurd] 21/23: Make netfs_S_io_reauthenticate handle allocation errors, Samuel Thibault, 2015/10/12
- [hurd] 20/23: Drop duplicate port deallocation,
Samuel Thibault <=
- [hurd] 14/23: libtrivfs: optimize the object lookup code, Samuel Thibault, 2015/10/12
- [hurd] 23/23: Merge remote-tracking branch 'upstream/master' into upstream, Samuel Thibault, 2015/10/12
- [hurd] 10/23: trans/magic: convert to trivfs dynamic classes and buckets, Samuel Thibault, 2015/10/12
- [hurd] 04/23: libdiskfs: fflush stdout when pausing, Samuel Thibault, 2015/10/12
- [hurd] 11/23: trans/new-fifo: convert to trivfs dynamic classes and buckets, Samuel Thibault, 2015/10/12
- [hurd] 07/23: pflocal: convert to trivfs dynamic classes and buckets, Samuel Thibault, 2015/10/12
- [hurd] 09/23: trans/ifsock: convert to trivfs dynamic classes and buckets, Samuel Thibault, 2015/10/12
- [hurd] 12/23: trans/passwd: convert to trivfs dynamic classes and buckets, Samuel Thibault, 2015/10/12
- [hurd] 13/23: trans/proxy-defpager: convert to trivfs dynamic classes and buckets, Samuel Thibault, 2015/10/15
- [hurd] 17/23: libdiskfs: fflush stdout when pausing, Samuel Thibault, 2015/10/15