summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-02 23:06:56 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2014-11-02 23:06:56 +0100
commit4370c33bccc2ef5bddacbd364270aa310f89c94d (patch)
treeddb187afcf690a50e68f77ca465f979035703391
parente6e1f1addd6f0f237e54f0a55a776c99aa4d72bd (diff)
Fix unlocking translator list
* libfshelp/translator-list.c (fshelp_set_active_translator): Use common out path to unlock translator_ihash_lock before exitting on error.
-rw-r--r--libfshelp/translator-list.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libfshelp/translator-list.c b/libfshelp/translator-list.c
index be7ce4de..c87bbaa3 100644
--- a/libfshelp/translator-list.c
+++ b/libfshelp/translator-list.c
@@ -82,7 +82,10 @@ fshelp_set_active_translator (struct port_info *pi,
t = malloc (sizeof (struct translator));
if (! t)
- return ENOMEM;
+ {
+ err = errno;
+ goto out;
+ }
t->active = MACH_PORT_NULL;
t->pi = NULL;
@@ -110,7 +113,7 @@ fshelp_set_active_translator (struct port_info *pi,
MACH_MSG_TYPE_MAKE_SEND_ONCE,
&old);
if (err)
- return err;
+ goto out;
if (old != MACH_PORT_NULL)
mach_port_deallocate (mach_task_self (), old);