diff options
author | Ulrich Drepper <drepper@redhat.com> | 2008-05-11 03:03:14 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2008-05-11 03:03:14 +0000 |
commit | 7e71e55f16e037042671cf70f8f130f26e494b74 (patch) | |
tree | 866217241a4e3f1c063bfb345ef5ca7663c7059b /nscd/hstcache.c | |
parent | d029664038effc7a3862768c4b615e80e1009ffb (diff) | |
download | glibc-7e71e55f16e037042671cf70f8f130f26e494b74.zip glibc-7e71e55f16e037042671cf70f8f130f26e494b74.tar.gz glibc-7e71e55f16e037042671cf70f8f130f26e494b74.tar.bz2 |
* nscd/cache.c (cache_add): Before returning with failure and this
is the first use of the record, mark it as unusable.
* nscd/aicache.c: Don't touch the dataset after cache_add returns
reporting a failure.
* nscd/grpcache.c: Likewise
* nscd/hstcache.c: Likewise.
* nscd/initgrcache.c: Likewise.
* nscd/pwdcache.c: Likewise.
* nscd/servicecache.c: Likewise.
Diffstat (limited to 'nscd/hstcache.c')
-rw-r--r-- | nscd/hstcache.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/nscd/hstcache.c b/nscd/hstcache.c index b93d418..3ceb671 100644 --- a/nscd/hstcache.c +++ b/nscd/hstcache.c @@ -155,10 +155,8 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req, /* Now get the lock to safely insert the records. */ pthread_rwlock_rdlock (&db->lock); - if (cache_add (req->type, &dataset->strdata, req->key_len, - &dataset->head, true, db, owner) < 0) - /* Ensure the data can be recovered. */ - dataset->head.usable = false; + (void) cache_add (req->type, &dataset->strdata, req->key_len, + &dataset->head, true, db, owner); pthread_rwlock_unlock (&db->lock); @@ -409,11 +407,8 @@ cache_addhst (struct database_dyn *db, int fd, request_header *req, || req->type == GETHOSTBYADDR || req->type == GETHOSTBYADDRv6); - if (cache_add (req->type, key_copy, req->key_len, - &dataset->head, true, db, owner) < 0) - /* Could not allocate memory. Make sure the - data gets discarded. */ - dataset->head.usable = false; + (void) cache_add (req->type, key_copy, req->key_len, + &dataset->head, true, db, owner); pthread_rwlock_unlock (&db->lock); } |