diff options
author | DJ Delorie <dj@redhat.com> | 2017-09-25 19:43:09 -0400 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2017-09-25 19:49:36 -0400 |
commit | 3de93d194a5d27cabfe40ddf58aea36939498ba4 (patch) | |
tree | 6fbd102829448ed8091cc7788d89a9f11f71e801 /nscd | |
parent | 5af1e931bfaf8ef28abd94c0c0ad14e4790cf429 (diff) | |
download | glibc-3de93d194a5d27cabfe40ddf58aea36939498ba4.zip glibc-3de93d194a5d27cabfe40ddf58aea36939498ba4.tar.gz glibc-3de93d194a5d27cabfe40ddf58aea36939498ba4.tar.bz2 |
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.
Diffstat (limited to 'nscd')
-rw-r--r-- | nscd/netgroupcache.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c index cd0c3ea..3ca96f8 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; } |