Browse Source

fixed possible uninit variables of the config-parser fails (merged [183])

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@551 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.2
Jan Kneschke 17 years ago
parent
commit
bac9212c8f
  1. 4
      src/mod_access.c
  2. 2
      src/mod_accesslog.c
  3. 4
      src/mod_alias.c
  4. 4
      src/mod_auth.c
  5. 4
      src/mod_cgi.c
  6. 2
      src/mod_evhost.c
  7. 4
      src/mod_expire.c
  8. 4
      src/mod_mysql_vhost.c
  9. 4
      src/mod_redirect.c
  10. 4
      src/mod_rewrite.c
  11. 4
      src/mod_rrdtool.c
  12. 4
      src/mod_secure_download.c
  13. 4
      src/mod_setenv.c
  14. 2
      src/mod_simple_vhost.c
  15. 4
      src/mod_skeleton.c
  16. 4
      src/mod_ssi.c
  17. 4
      src/mod_status.c
  18. 4
      src/mod_userdir.c
  19. 4
      src/mod_usertrack.c

4
src/mod_access.c

@ -63,12 +63,12 @@ SETDEFAULTS_FUNC(mod_access_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->access_deny = array_init();
cv[0].destination = s->access_deny;

2
src/mod_accesslog.c

@ -330,6 +330,8 @@ FREE_FUNC(mod_accesslog_free) {
if (!s) continue;
if (!s) continue;
if (s->access_logbuffer->used) {
if (s->use_syslog) {
# ifdef HAVE_SYSLOG_H

4
src/mod_alias.c

@ -73,12 +73,12 @@ SETDEFAULTS_FUNC(mod_alias_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->alias = array_init();
cv[0].destination = s->alias;

4
src/mod_auth.c

@ -305,7 +305,7 @@ SETDEFAULTS_FUNC(mod_auth_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
mod_auth_plugin_config *s;
@ -313,7 +313,7 @@ SETDEFAULTS_FUNC(mod_auth_set_defaults) {
data_array *da;
array *ca;
s = malloc(sizeof(mod_auth_plugin_config));
s = calloc(1, sizeof(mod_auth_plugin_config));
s->auth_plain_groupfile = buffer_init();
s->auth_plain_userfile = buffer_init();
s->auth_htdigest_userfile = buffer_init();

4
src/mod_cgi.c

@ -147,12 +147,12 @@ SETDEFAULTS_FUNC(mod_fastcgi_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
assert(s);
s->cgi = array_init();

2
src/mod_evhost.c

@ -124,7 +124,7 @@ SETDEFAULTS_FUNC(mod_evhost_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;

4
src/mod_expire.c

@ -215,12 +215,12 @@ SETDEFAULTS_FUNC(mod_expire_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->expire_url = array_init();
cv[0].destination = s->expire_url;

4
src/mod_mysql_vhost.c

@ -178,14 +178,14 @@ SERVER_FUNC(mod_mysql_vhost_set_defaults) {
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET }
};
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
buffer *sel;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->mydb = buffer_init();
s->myuser = buffer_init();
s->mypass = buffer_init();

4
src/mod_redirect.c

@ -78,7 +78,7 @@ SETDEFAULTS_FUNC(mod_redirect_set_defaults) {
if (!p) return HANDLER_ERROR;
/* 0 */
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
@ -86,7 +86,7 @@ SETDEFAULTS_FUNC(mod_redirect_set_defaults) {
array *ca;
data_array *da = (data_array *)du;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->redirect = pcre_keyvalue_buffer_init();
cv[0].destination = s->redirect;

4
src/mod_rewrite.c

@ -238,13 +238,13 @@ SETDEFAULTS_FUNC(mod_rewrite_set_defaults) {
if (!p) return HANDLER_ERROR;
/* 0 */
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
array *ca;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->rewrite = rewrite_rule_buffer_init();
cv[0].destination = s->rewrite;

4
src/mod_rrdtool.c

@ -301,12 +301,12 @@ SETDEFAULTS_FUNC(mod_rrd_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->path_rrdtool_bin = buffer_init();
s->path_rrd = buffer_init();
s->requests = 0;

4
src/mod_secure_download.c

@ -106,12 +106,12 @@ SETDEFAULTS_FUNC(mod_secdownload_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->secret = buffer_init();
s->doc_root = buffer_init();
s->uri_prefix = buffer_init();

4
src/mod_setenv.c

@ -79,12 +79,12 @@ SETDEFAULTS_FUNC(mod_setenv_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->request_header = array_init();
s->response_header = array_init();
s->environment = array_init();

2
src/mod_simple_vhost.c

@ -89,7 +89,7 @@ SETDEFAULTS_FUNC(mod_simple_vhost_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;

4
src/mod_skeleton.c

@ -107,12 +107,12 @@ SETDEFAULTS_FUNC(mod_skeleton_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->match = array_init();
cv[0].destination = s->match;

4
src/mod_ssi.c

@ -94,12 +94,12 @@ SETDEFAULTS_FUNC(mod_ssi_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->ssi_extension = array_init();
cv[0].destination = s->ssi_extension;

4
src/mod_status.c

@ -110,12 +110,12 @@ SETDEFAULTS_FUNC(mod_status_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->config_url = buffer_init();
s->status_url = buffer_init();
s->sort = 1;

4
src/mod_userdir.c

@ -88,12 +88,12 @@ SETDEFAULTS_FUNC(mod_userdir_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->exclude_user = array_init();
s->include_user = array_init();
s->path = buffer_init();

4
src/mod_usertrack.c

@ -83,12 +83,12 @@ SETDEFAULTS_FUNC(mod_usertrack_set_defaults) {
if (!p) return HANDLER_ERROR;
p->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
for (i = 0; i < srv->config_context->used; i++) {
plugin_config *s;
s = malloc(sizeof(plugin_config));
s = calloc(1, sizeof(plugin_config));
s->cookie_name = buffer_init();
s->cookie_domain = buffer_init();
s->cookie_max_age = 0;

Loading…
Cancel
Save