aboutsummaryrefslogtreecommitdiff
path: root/nscd/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'nscd/mem.c')
-rw-r--r--nscd/mem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/nscd/mem.c b/nscd/mem.c
index fcea6dbd03..80ea951146 100644
--- a/nscd/mem.c
+++ b/nscd/mem.c
@@ -566,9 +566,6 @@ mempool_alloc (struct database_dyn *db, size_t len, int data_alloc)
}
}
- if (data_alloc)
- pthread_rwlock_unlock (&db->lock);
-
if (! db->last_alloc_failed)
{
dbg_log (_("no more memory for database '%s'"), dbnames[db - dbs]);
@@ -591,5 +588,8 @@ mempool_alloc (struct database_dyn *db, size_t len, int data_alloc)
pthread_mutex_unlock (&db->memlock);
+ if (data_alloc)
+ pthread_rwlock_unlock (&db->lock);
+
return res;
}