commit-hurd
[Top][All Lists]
Advanced

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

[hurd] 31/61: libports: unlock _ports_lock on malloc failure


From: Samuel Thibault
Subject: [hurd] 31/61: libports: unlock _ports_lock on malloc failure
Date: Tue, 27 May 2014 08:32:11 +0000

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

sthibault pushed a commit to branch upstream
in repository hurd.

commit 3ad900b84497a2e619c30f76670e4757e8765f3e
Author: Justus Winter <address@hidden>
Date:   Sun May 4 12:14:58 2014 +0200

    libports: unlock _ports_lock on malloc failure
    
    * libports/bucket-iterate.c (_ports_bucket_class_iterate): Unlock
    _ports_lock on malloc failure.
---
 libports/bucket-iterate.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libports/bucket-iterate.c b/libports/bucket-iterate.c
index 498cf13..babc204 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)

-- 
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]