commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 25/26: libports: fix error handling in _ports_create_port_interna


From: Samuel Thibault
Subject: [hurd] 25/26: libports: fix error handling in _ports_create_port_internal
Date: Sat, 02 Nov 2013 14:44:47 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit 880dd56f468b57a198ab2136767d03ddaa586eef
Author: Justus Winter <address@hidden>
Date:   Fri Nov 1 22:53:12 2013 +0100

    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.
---
 libports/create-internal.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libports/create-internal.c b/libports/create-internal.c
index c60f6fd..572a55a 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;

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]