Browse Source

removed segfault if parsing config fails

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@413 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.3.15
Jan Kneschke 17 years ago
parent
commit
288b0b51e7
  1. 2
      src/config.c
  2. 3
      src/server.c

2
src/config.c

@ -108,7 +108,7 @@ static int config_insert(server *srv) {
cv[36].destination = &(srv->srvconf.log_request_header_on_error);
cv[37].destination = &(srv->srvconf.log_state_handling);
srv->config_storage = malloc(srv->config_context->used * sizeof(specific_config *));
srv->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *));
assert(srv->config_storage);

3
src/server.c

@ -235,6 +235,9 @@ static void server_free(server *srv) {
if (srv->config_storage) {
for (i = 0; i < srv->config_context->used; i++) {
specific_config *s = srv->config_storage[i];
if (!s) continue;
buffer_free(s->document_root);
buffer_free(s->server_name);
buffer_free(s->server_tag);

Loading…
Cancel
Save