summaryrefslogtreecommitdiff
path: root/src/stat_cache.c
diff options
context:
space:
mode:
authorStefan Bühler <stbuehler@web.de>2016-01-30 13:59:07 +0000
committerStefan Bühler <stbuehler@web.de>2016-01-30 13:59:07 +0000
commit566cf8decbd63d921e914041d5d7940314ef2f1c (patch)
treeafbec8540185c46386fc4f2ccecf37ec5dcf0efd /src/stat_cache.c
parentf3b577ddee36b9555331dfbcddb6a200df2ba438 (diff)
downloadlighttpd1.4-566cf8decbd63d921e914041d5d7940314ef2f1c.tar.gz
lighttpd1.4-566cf8decbd63d921e914041d5d7940314ef2f1c.zip
add force_assert for more allocation results
From: Stefan Bühler <stbuehler@web.de> git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3072 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/stat_cache.c')
-rw-r--r--src/stat_cache.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/stat_cache.c b/src/stat_cache.c
index 8aab29de..18bf4c3c 100644
--- a/src/stat_cache.c
+++ b/src/stat_cache.c
@@ -108,6 +108,7 @@ stat_cache *stat_cache_init(void) {
stat_cache *sc = NULL;
sc = calloc(1, sizeof(*sc));
+ force_assert(NULL != sc);
sc->dir_name = buffer_init();
sc->hash_key = buffer_init();
@@ -127,6 +128,7 @@ static stat_cache_entry * stat_cache_entry_init(void) {
stat_cache_entry *sce = NULL;
sce = calloc(1, sizeof(*sce));
+ force_assert(NULL != sce);
sce->name = buffer_init();
sce->etag = buffer_init();
@@ -151,6 +153,7 @@ static fam_dir_entry * fam_dir_entry_init(void) {
fam_dir_entry *fam_dir = NULL;
fam_dir = calloc(1, sizeof(*fam_dir));
+ force_assert(NULL != fam_dir);
fam_dir->name = buffer_init();
@@ -518,9 +521,11 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
ctrl.size = 16;
ctrl.used = 0;
ctrl.ptr = malloc(ctrl.size * sizeof(*ctrl.ptr));
+ force_assert(NULL != ctrl.ptr);
} else if (ctrl.size == ctrl.used) {
ctrl.size += 16;
ctrl.ptr = realloc(ctrl.ptr, ctrl.size * sizeof(*ctrl.ptr));
+ force_assert(NULL != ctrl.ptr);
}
ctrl.ptr[ctrl.used++] = file_ndx;
@@ -640,6 +645,7 @@ handler_t stat_cache_get_entry(server *srv, connection *con, buffer *name, stat_
fam_dir->version = 1;
fam_dir->req = calloc(1, sizeof(FAMRequest));
+ force_assert(NULL != fam_dir);
if (0 != FAMMonitorDirectory(&sc->fam, fam_dir->name->ptr,
fam_dir->req, fam_dir)) {
@@ -719,6 +725,7 @@ int stat_cache_trigger_cleanup(server *srv) {
if (!sc->files) return 0;
keys = calloc(1, sizeof(int) * sc->files->size);
+ force_assert(NULL != keys);
stat_cache_tag_old_entries(srv, sc->files, keys, &max_ndx);