summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMohammed Sadiq <sadiq@sadiqpk.org>2019-02-27 18:12:48 +0530
committerGlenn Strauss <gstrauss@gluelogic.com>2019-04-20 02:09:04 -0400
commit6a988bb0d0148db1646be7c07aa81922afc9cc7f (patch)
treec536c29f5f1e95835630abe45f41515b3980f3d6
parent599b4f05c8ccebd0c06074972824b930afc9c832 (diff)
downloadlighttpd1.4-6a988bb0d0148db1646be7c07aa81922afc9cc7f.zip
lighttpd1.4-6a988bb0d0148db1646be7c07aa81922afc9cc7f.tar.gz
[multiple] cleaner calloc use in SETDEFAULTS_FUNC
github: closes #99 x-ref: "cleaner calloc use in SETDEFAULTS_FUNC" https://github.com/lighttpd/lighttpd1.4/pull/99
-rw-r--r--src/mod_access.c2
-rw-r--r--src/mod_accesslog.c2
-rw-r--r--src/mod_alias.c2
-rw-r--r--src/mod_auth.c2
-rw-r--r--src/mod_authn_file.c2
-rw-r--r--src/mod_authn_gssapi.c2
-rw-r--r--src/mod_authn_ldap.c2
-rw-r--r--src/mod_authn_mysql.c2
-rw-r--r--src/mod_authn_pam.c2
-rw-r--r--src/mod_authn_sasl.c2
-rw-r--r--src/mod_cgi.c2
-rw-r--r--src/mod_cml.c2
-rw-r--r--src/mod_compress.c2
-rw-r--r--src/mod_deflate.c2
-rw-r--r--src/mod_dirlisting.c2
-rw-r--r--src/mod_evasive.c2
-rw-r--r--src/mod_evhost.c2
-rw-r--r--src/mod_expire.c2
-rw-r--r--src/mod_extforward.c2
-rw-r--r--src/mod_fastcgi.c2
-rw-r--r--src/mod_flv_streaming.c2
-rw-r--r--src/mod_geoip.c2
-rw-r--r--src/mod_indexfile.c2
-rw-r--r--src/mod_magnet.c2
-rw-r--r--src/mod_mysql_vhost.c2
-rw-r--r--src/mod_openssl.c2
-rw-r--r--src/mod_proxy.c2
-rw-r--r--src/mod_redirect.c2
-rw-r--r--src/mod_rewrite.c2
-rw-r--r--src/mod_rrdtool.c2
-rw-r--r--src/mod_scgi.c2
-rw-r--r--src/mod_secdownload.c2
-rw-r--r--src/mod_setenv.c2
-rw-r--r--src/mod_simple_vhost.c2
-rw-r--r--src/mod_skeleton.c2
-rw-r--r--src/mod_sockproxy.c2
-rw-r--r--src/mod_ssi.c2
-rw-r--r--src/mod_staticfile.c2
-rw-r--r--src/mod_status.c2
-rw-r--r--src/mod_trigger_b4_dl.c2
-rw-r--r--src/mod_uploadprogress.c2
-rw-r--r--src/mod_userdir.c2
-rw-r--r--src/mod_usertrack.c2
-rw-r--r--src/mod_vhostdb.c2
-rw-r--r--src/mod_vhostdb_dbi.c2
-rw-r--r--src/mod_vhostdb_ldap.c2
-rw-r--r--src/mod_vhostdb_mysql.c2
-rw-r--r--src/mod_vhostdb_pgsql.c2
-rw-r--r--src/mod_webdav.c2
-rw-r--r--src/mod_wstunnel.c2
50 files changed, 50 insertions, 50 deletions
diff --git a/src/mod_access.c b/src/mod_access.c
index 9798f88..1e7e9b2 100644
--- a/src/mod_access.c
+++ b/src/mod_access.c
@@ -67,7 +67,7 @@ SETDEFAULTS_FUNC(mod_access_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_accesslog.c b/src/mod_accesslog.c
index 3cc24a7..7730013 100644
--- a/src/mod_accesslog.c
+++ b/src/mod_accesslog.c
@@ -487,7 +487,7 @@ SETDEFAULTS_FUNC(log_access_open) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_alias.c b/src/mod_alias.c
index cd9414f..bab1b67 100644
--- a/src/mod_alias.c
+++ b/src/mod_alias.c
@@ -72,7 +72,7 @@ SETDEFAULTS_FUNC(mod_alias_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_auth.c b/src/mod_auth.c
index f0bb400..5dcdfd2 100644
--- a/src/mod_auth.c
+++ b/src/mod_auth.c
@@ -281,7 +281,7 @@ SETDEFAULTS_FUNC(mod_auth_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_authn_file.c b/src/mod_authn_file.c
index 6264d62..1e16075 100644
--- a/src/mod_authn_file.c
+++ b/src/mod_authn_file.c
@@ -130,7 +130,7 @@ SETDEFAULTS_FUNC(mod_authn_file_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_authn_gssapi.c b/src/mod_authn_gssapi.c
index 6ed61ee..ef0c8bb 100644
--- a/src/mod_authn_gssapi.c
+++ b/src/mod_authn_gssapi.c
@@ -104,7 +104,7 @@ SETDEFAULTS_FUNC(mod_authn_gssapi_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_authn_ldap.c b/src/mod_authn_ldap.c
index 233fc23..26191f5 100644
--- a/src/mod_authn_ldap.c
+++ b/src/mod_authn_ldap.c
@@ -133,7 +133,7 @@ config_values_t cv[] = {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_authn_mysql.c b/src/mod_authn_mysql.c
index f4bd9bd..c1f881f 100644
--- a/src/mod_authn_mysql.c
+++ b/src/mod_authn_mysql.c
@@ -203,7 +203,7 @@ SETDEFAULTS_FUNC(mod_authn_mysql_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_authn_pam.c b/src/mod_authn_pam.c
index 2439f1d..eddba69 100644
--- a/src/mod_authn_pam.c
+++ b/src/mod_authn_pam.c
@@ -71,7 +71,7 @@ SETDEFAULTS_FUNC(mod_authn_pam_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (size_t i = 0; i < srv->config_context->used; ++i) {
data_config const *config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_authn_sasl.c b/src/mod_authn_sasl.c
index d4c46e3..7ea00b8 100644
--- a/src/mod_authn_sasl.c
+++ b/src/mod_authn_sasl.c
@@ -82,7 +82,7 @@ SETDEFAULTS_FUNC(mod_authn_sasl_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const *config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_cgi.c b/src/mod_cgi.c
index 96a56f8..642859c 100644
--- a/src/mod_cgi.c
+++ b/src/mod_cgi.c
@@ -186,7 +186,7 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
force_assert(p->config_storage);
for (i = 0; i < srv->config_context->used; i++) {
diff --git a/src/mod_cml.c b/src/mod_cml.c
index c82a4c2..16ecdfd 100644
--- a/src/mod_cml.c
+++ b/src/mod_cml.c
@@ -82,7 +82,7 @@ SETDEFAULTS_FUNC(mod_cml_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_compress.c b/src/mod_compress.c
index dc8babc..93b298a 100644
--- a/src/mod_compress.c
+++ b/src/mod_compress.c
@@ -185,7 +185,7 @@ SETDEFAULTS_FUNC(mod_compress_setdefaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_deflate.c b/src/mod_deflate.c
index 690b2fe..0977fee 100644
--- a/src/mod_deflate.c
+++ b/src/mod_deflate.c
@@ -282,7 +282,7 @@ SETDEFAULTS_FUNC(mod_deflate_setdefaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
diff --git a/src/mod_dirlisting.c b/src/mod_dirlisting.c
index 0144a9b..1c5c77c 100644
--- a/src/mod_dirlisting.c
+++ b/src/mod_dirlisting.c
@@ -229,7 +229,7 @@ SETDEFAULTS_FUNC(mod_dirlisting_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_evasive.c b/src/mod_evasive.c
index 9171d5c..3505b3a 100644
--- a/src/mod_evasive.c
+++ b/src/mod_evasive.c
@@ -85,7 +85,7 @@ SETDEFAULTS_FUNC(mod_evasive_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_evhost.c b/src/mod_evhost.c
index 56450a8..311c2cc 100644
--- a/src/mod_evhost.c
+++ b/src/mod_evhost.c
@@ -152,7 +152,7 @@ SETDEFAULTS_FUNC(mod_evhost_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_expire.c b/src/mod_expire.c
index d0f771b..ae7714b 100644
--- a/src/mod_expire.c
+++ b/src/mod_expire.c
@@ -226,7 +226,7 @@ SETDEFAULTS_FUNC(mod_expire_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_extforward.c b/src/mod_extforward.c
index 1523531..f100dae 100644
--- a/src/mod_extforward.c
+++ b/src/mod_extforward.c
@@ -196,7 +196,7 @@ SETDEFAULTS_FUNC(mod_extforward_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_fastcgi.c b/src/mod_fastcgi.c
index 42e16c5..6fb01dd 100644
--- a/src/mod_fastcgi.c
+++ b/src/mod_fastcgi.c
@@ -50,7 +50,7 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
force_assert(p->config_storage);
for (i = 0; i < srv->config_context->used; i++) {
diff --git a/src/mod_flv_streaming.c b/src/mod_flv_streaming.c
index cb6186f..427f877 100644
--- a/src/mod_flv_streaming.c
+++ b/src/mod_flv_streaming.c
@@ -60,7 +60,7 @@ SETDEFAULTS_FUNC(mod_flv_streaming_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_geoip.c b/src/mod_geoip.c
index 12c855d..a40ac8c 100644
--- a/src/mod_geoip.c
+++ b/src/mod_geoip.c
@@ -125,7 +125,7 @@ SETDEFAULTS_FUNC(mod_geoip_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_indexfile.c b/src/mod_indexfile.c
index a48681b..a06a4bf 100644
--- a/src/mod_indexfile.c
+++ b/src/mod_indexfile.c
@@ -83,7 +83,7 @@ SETDEFAULTS_FUNC(mod_indexfile_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_magnet.c b/src/mod_magnet.c
index 8f570f3..9af3482 100644
--- a/src/mod_magnet.c
+++ b/src/mod_magnet.c
@@ -102,7 +102,7 @@ SETDEFAULTS_FUNC(mod_magnet_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_mysql_vhost.c b/src/mod_mysql_vhost.c
index 2af5cc2..039422c 100644
--- a/src/mod_mysql_vhost.c
+++ b/src/mod_mysql_vhost.c
@@ -149,7 +149,7 @@ SERVER_FUNC(mod_mysql_vhost_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_openssl.c b/src/mod_openssl.c
index 33815b5..68b889a 100644
--- a/src/mod_openssl.c
+++ b/src/mod_openssl.c
@@ -1208,7 +1208,7 @@ SETDEFAULTS_FUNC(mod_openssl_set_defaults)
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (size_t i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_proxy.c b/src/mod_proxy.c
index 9759446..a6b05b8 100644
--- a/src/mod_proxy.c
+++ b/src/mod_proxy.c
@@ -122,7 +122,7 @@ SETDEFAULTS_FUNC(mod_proxy_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_redirect.c b/src/mod_redirect.c
index 94c76d8..55b431d 100644
--- a/src/mod_redirect.c
+++ b/src/mod_redirect.c
@@ -60,7 +60,7 @@ SETDEFAULTS_FUNC(mod_redirect_set_defaults) {
if (!p) return HANDLER_ERROR;
/* 0 */
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_rewrite.c b/src/mod_rewrite.c
index 1280d97..6a352f4 100644
--- a/src/mod_rewrite.c
+++ b/src/mod_rewrite.c
@@ -132,7 +132,7 @@ SETDEFAULTS_FUNC(mod_rewrite_set_defaults) {
if (!p) return HANDLER_ERROR;
/* 0 */
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_rrdtool.c b/src/mod_rrdtool.c
index 009943d..9fca757 100644
--- a/src/mod_rrdtool.c
+++ b/src/mod_rrdtool.c
@@ -304,7 +304,7 @@ SETDEFAULTS_FUNC(mod_rrd_set_defaults) {
if (!p) return HANDLER_ERROR;
force_assert(srv->config_context->used > 0);
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_scgi.c b/src/mod_scgi.c
index 785e66a..6784a9d 100644
--- a/src/mod_scgi.c
+++ b/src/mod_scgi.c
@@ -34,7 +34,7 @@ SETDEFAULTS_FUNC(mod_scgi_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
force_assert(p->config_storage);
for (i = 0; i < srv->config_context->used; i++) {
diff --git a/src/mod_secdownload.c b/src/mod_secdownload.c
index ccbaeaf..28299c6 100644
--- a/src/mod_secdownload.c
+++ b/src/mod_secdownload.c
@@ -283,7 +283,7 @@ SETDEFAULTS_FUNC(mod_secdownload_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_setenv.c b/src/mod_setenv.c
index 43eb7ab..b3832ec 100644
--- a/src/mod_setenv.c
+++ b/src/mod_setenv.c
@@ -108,7 +108,7 @@ SETDEFAULTS_FUNC(mod_setenv_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_simple_vhost.c b/src/mod_simple_vhost.c
index 1fae140..0639b55 100644
--- a/src/mod_simple_vhost.c
+++ b/src/mod_simple_vhost.c
@@ -90,7 +90,7 @@ SETDEFAULTS_FUNC(mod_simple_vhost_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_skeleton.c b/src/mod_skeleton.c
index 464f7b8..48efe64 100644
--- a/src/mod_skeleton.c
+++ b/src/mod_skeleton.c
@@ -89,7 +89,7 @@ SETDEFAULTS_FUNC(mod_skeleton_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
force_assert(p->config_storage);
for (i = 0; i < srv->config_context->used; i++) {
diff --git a/src/mod_sockproxy.c b/src/mod_sockproxy.c
index 27d69ee..2203bec 100644
--- a/src/mod_sockproxy.c
+++ b/src/mod_sockproxy.c
@@ -32,7 +32,7 @@ SETDEFAULTS_FUNC(mod_sockproxy_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
force_assert(p->config_storage);
for (i = 0; i < srv->config_context->used; i++) {
diff --git a/src/mod_ssi.c b/src/mod_ssi.c
index f05f8a6..a44ff1a 100644
--- a/src/mod_ssi.c
+++ b/src/mod_ssi.c
@@ -119,7 +119,7 @@ SETDEFAULTS_FUNC(mod_ssi_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_staticfile.c b/src/mod_staticfile.c
index d4fa2c8..e858375 100644
--- a/src/mod_staticfile.c
+++ b/src/mod_staticfile.c
@@ -87,7 +87,7 @@ SETDEFAULTS_FUNC(mod_staticfile_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_status.c b/src/mod_status.c
index 70e3d3a..256b133 100644
--- a/src/mod_status.c
+++ b/src/mod_status.c
@@ -113,7 +113,7 @@ SETDEFAULTS_FUNC(mod_status_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_trigger_b4_dl.c b/src/mod_trigger_b4_dl.c
index 6a43b25..c78d5c8 100644
--- a/src/mod_trigger_b4_dl.c
+++ b/src/mod_trigger_b4_dl.c
@@ -144,7 +144,7 @@ SETDEFAULTS_FUNC(mod_trigger_b4_dl_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_uploadprogress.c b/src/mod_uploadprogress.c
index bf2a20e..80f5c25 100644
--- a/src/mod_uploadprogress.c
+++ b/src/mod_uploadprogress.c
@@ -196,7 +196,7 @@ SETDEFAULTS_FUNC(mod_uploadprogress_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_userdir.c b/src/mod_userdir.c
index e2ea08d..7b4aad7 100644
--- a/src/mod_userdir.c
+++ b/src/mod_userdir.c
@@ -101,7 +101,7 @@ SETDEFAULTS_FUNC(mod_userdir_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_usertrack.c b/src/mod_usertrack.c
index 701bb1e..932c75e 100644
--- a/src/mod_usertrack.c
+++ b/src/mod_usertrack.c
@@ -85,7 +85,7 @@ SETDEFAULTS_FUNC(mod_usertrack_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_vhostdb.c b/src/mod_vhostdb.c
index ca75183..f65c696 100644
--- a/src/mod_vhostdb.c
+++ b/src/mod_vhostdb.c
@@ -65,7 +65,7 @@ SETDEFAULTS_FUNC(mod_vhostdb_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (size_t i = 0; i < srv->config_context->used; ++i) {
data_config const *config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_vhostdb_dbi.c b/src/mod_vhostdb_dbi.c
index 0c78e12..ac3f245 100644
--- a/src/mod_vhostdb_dbi.c
+++ b/src/mod_vhostdb_dbi.c
@@ -259,7 +259,7 @@ SETDEFAULTS_FUNC(mod_vhostdb_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (size_t i = 0; i < srv->config_context->used; ++i) {
data_config const *config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_vhostdb_ldap.c b/src/mod_vhostdb_ldap.c
index e81c493..e5362c4 100644
--- a/src/mod_vhostdb_ldap.c
+++ b/src/mod_vhostdb_ldap.c
@@ -484,7 +484,7 @@ SETDEFAULTS_FUNC(mod_vhostdb_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (size_t i = 0; i < srv->config_context->used; ++i) {
data_config const *config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_vhostdb_mysql.c b/src/mod_vhostdb_mysql.c
index 5905bc8..b3acfed 100644
--- a/src/mod_vhostdb_mysql.c
+++ b/src/mod_vhostdb_mysql.c
@@ -223,7 +223,7 @@ SETDEFAULTS_FUNC(mod_vhostdb_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (size_t i = 0; i < srv->config_context->used; ++i) {
data_config const *config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_vhostdb_pgsql.c b/src/mod_vhostdb_pgsql.c
index a87f435..c8da1e6 100644
--- a/src/mod_vhostdb_pgsql.c
+++ b/src/mod_vhostdb_pgsql.c
@@ -200,7 +200,7 @@ SETDEFAULTS_FUNC(mod_vhostdb_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (size_t i = 0; i < srv->config_context->used; ++i) {
data_config const *config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_webdav.c b/src/mod_webdav.c
index 7d0e422..55c8395 100644
--- a/src/mod_webdav.c
+++ b/src/mod_webdav.c
@@ -184,7 +184,7 @@ SETDEFAULTS_FUNC(mod_webdav_set_defaults) {
if (!p) return HANDLER_ERROR;
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
for (i = 0; i < srv->config_context->used; i++) {
data_config const* config = (data_config const*)srv->config_context->data[i];
diff --git a/src/mod_wstunnel.c b/src/mod_wstunnel.c
index ba3ddc1..f05daac 100644
--- a/src/mod_wstunnel.c
+++ b/src/mod_wstunnel.c
@@ -214,7 +214,7 @@ SETDEFAULTS_FUNC(mod_wstunnel_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
- p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *));
+ p->config_storage = calloc(srv->config_context->used, sizeof(plugin_config *));
force_assert(p->config_storage);
for (size_t i = 0; i < srv->config_context->used; ++i) {
array *ca = ((data_config *)(srv->config_context->data[i]))->value;