Browse Source

[core] calloc plugin_config for consistent init

personal/stbuehler/mod-csrf
Glenn Strauss 5 years ago
parent
commit
1465cf80f9
  1. 2
      src/mod_cml.c
  2. 2
      src/mod_fastcgi.c
  3. 2
      src/mod_proxy.c
  4. 2
      src/mod_scgi.c
  5. 8
      src/mod_skeleton.c

2
src/mod_cml.c

@ -90,7 +90,7 @@ SETDEFAULTS_FUNC(mod_cml_set_defaults) {
data_config const* config = (data_config const*)srv->config_context->data[i];
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->ext = buffer_init();
s->mc_hosts = array_init();
s->mc_namespace = buffer_init();

2
src/mod_fastcgi.c

@ -1282,7 +1282,7 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
data_config const* config = (data_config const*)srv->config_context->data[i];
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->exts = NULL;
s->exts_auth = NULL;
s->exts_resp = NULL;

2
src/mod_proxy.c

@ -198,7 +198,7 @@ SETDEFAULTS_FUNC(mod_proxy_set_defaults) {
data_config const* config = (data_config const*)srv->config_context->data[i];
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->extensions = array_init();
s->debug = 0;
s->replace_http_host = 0;

2
src/mod_scgi.c

@ -1021,7 +1021,7 @@ SETDEFAULTS_FUNC(mod_scgi_set_defaults) {
data_config const* config = (data_config const*)srv->config_context->data[i];
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
force_assert(s);
s->exts = scgi_extensions_init();
s->debug = 0;

8
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;

Loading…
Cancel
Save