diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2013-11-01 22:53:12 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2013-11-01 22:53:12 +0100 |
commit | 880dd56f468b57a198ab2136767d03ddaa586eef (patch) | |
tree | 25c9257dea2b7f332203c5b4fc01f92bfe4147f3 /libports | |
parent | a274a4f22c83c536744e77e3dc873417912a1928 (diff) |
libports: fix error handling in _ports_create_port_internal
Previously any err value set before reaching lose: was overwritten and
thus not properly propagated.
Found using the Clang Static Analyzer.
* libports/create-internal.c (_ports_create_port_internal): Fix error
handling.
Diffstat (limited to 'libports')
-rw-r--r-- | libports/create-internal.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libports/create-internal.c b/libports/create-internal.c index c60f6fd9..572a55a8 100644 --- a/libports/create-internal.c +++ b/libports/create-internal.c @@ -109,10 +109,11 @@ _ports_create_port_internal (struct port_class *class, err = EINTR; lose: pthread_mutex_unlock (&_ports_lock); - lose_unlocked: - err = mach_port_mod_refs (mach_task_self (), port, - MACH_PORT_RIGHT_RECEIVE, -1); - assert_perror (err); + lose_unlocked:; + error_t e; + e = mach_port_mod_refs (mach_task_self (), port, + MACH_PORT_RIGHT_RECEIVE, -1); + assert_perror (e); free (pi); return err; |