From 3de93d194a5d27cabfe40ddf58aea36939498ba4 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Mon, 25 Sep 2017 19:43:09 -0400 Subject: nscd: Release read lock after resetting timeout. [BZ #22161] * nscd/netgroupcache.c (addinnetgrX): Release read lock after resetting timeout. Reviewed-by: Jonathan Nieder Reviewed-by: Andreas Schwab A lock is held by mempool_allocate() when CACHEABLE is true; we must release this lock if we exit early. --- nscd/netgroupcache.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'nscd') diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c index cd0c3ea19b..3ca96f8205 100644 --- a/nscd/netgroupcache.c +++ b/nscd/netgroupcache.c @@ -584,6 +584,8 @@ addinnetgrX (struct database_dyn *db, int fd, request_header *req, dh->timeout = timeout; dh->ttl = dataset->head.ttl; ++dh->nreloads; + if (cacheable) + pthread_rwlock_unlock (&db->lock); return timeout; } -- cgit v1.2.3-65-gdbad