diff options
author | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-05-04 12:14:58 +0200 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2014-05-05 17:30:58 +0200 |
commit | 3ad900b84497a2e619c30f76670e4757e8765f3e (patch) | |
tree | 0a1caa616e0057856354a9e4a419e13d0c9064e1 /libports | |
parent | 8612278973d167a20f4d60d018f18c6975b37cca (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.c | 5 |
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) |