summaryrefslogtreecommitdiff
path: root/libports
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-05-04 12:14:58 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-05-05 17:30:58 +0200
commit3ad900b84497a2e619c30f76670e4757e8765f3e (patch)
tree0a1caa616e0057856354a9e4a419e13d0c9064e1 /libports
parent8612278973d167a20f4d60d018f18c6975b37cca (diff)
libports: unlock _ports_lock on malloc failure
* libports/bucket-iterate.c (_ports_bucket_class_iterate): Unlock _ports_lock on malloc failure.
Diffstat (limited to 'libports')
-rw-r--r--libports/bucket-iterate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libports/bucket-iterate.c b/libports/bucket-iterate.c
index 498cf133..babc2045 100644
--- a/libports/bucket-iterate.c
+++ b/libports/bucket-iterate.c
@@ -46,7 +46,10 @@ _ports_bucket_class_iterate (struct port_bucket *bucket,
nr_items = bucket->htable.nr_items;
p = malloc (nr_items * sizeof *p);
if (p == NULL)
- return ENOMEM;
+ {
+ pthread_mutex_unlock (&_ports_lock);
+ return ENOMEM;
+ }
n = 0;
HURD_IHASH_ITERATE (&bucket->htable, arg)