nscd: Release read lock after resetting timeout.

[BZ #22161]
	* nscd/netgroupcache.c (addinnetgrX): Release read lock after
	resetting timeout.

Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Reviewed-by: Andreas Schwab <schwab@suse.de>

A lock is held by mempool_allocate() when CACHEABLE is true; we
must release this lock if we exit early.
This commit is contained in:
DJ Delorie 2017-09-25 19:43:09 -04:00
parent 5af1e931bf
commit 3de93d194a
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2017-09-25 DJ Delorie <dj@redhat.com>
[BZ #22161]
* nscd/netgroupcache.c (addinnetgrX): Release read lock after
resetting timeout.
2017-09-25 Stefan Liebler <stli@linux.vnet.ibm.com>
* sysdeps/ieee754/dbl-64/sincos32.h

View File

@ -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;
}