summaryrefslogtreecommitdiff
path: root/src/mod_skeleton.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2017-04-30 20:37:33 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2017-04-30 20:38:03 -0400
commit1465cf80f90de51920e9d125a2dcb24beaaba3af (patch)
tree027ef5c322fe6584d837471bf3fe4848d4bc358c /src/mod_skeleton.c
parent9c0ef6876db7e71f92886af15d7b3a9c0c843926 (diff)
downloadlighttpd-git-1465cf80f90de51920e9d125a2dcb24beaaba3af.tar.gz
[core] calloc plugin_config for consistent init
Diffstat (limited to 'src/mod_skeleton.c')
-rw-r--r--src/mod_skeleton.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mod_skeleton.c b/src/mod_skeleton.c
index 60f211cc..bc182da2 100644
--- a/src/mod_skeleton.c
+++ b/src/mod_skeleton.c
@@ -46,6 +46,7 @@ static handler_ctx * handler_ctx_init() {
handler_ctx * hctx;
hctx = calloc(1, sizeof(*hctx));
+ force_assert(hctx);
return hctx;
}
@@ -60,6 +61,7 @@ INIT_FUNC(mod_skeleton_init) {
plugin_data *p;
p = calloc(1, sizeof(*p));
+ force_assert(p);
p->match_buf = buffer_init();
@@ -110,12 +112,12 @@ SETDEFAULTS_FUNC(mod_skeleton_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ force_assert(p->config_storage);
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
- plugin_config *s;
-
- s = calloc(1, sizeof(plugin_config));
+ plugin_config *s = calloc(1, sizeof(plugin_config));
+ force_assert(s);
s->match = array_init();
cv[0].destination = s->match;