From 4c265a6fd8c2a9dc763ffe21781ed94d97c2b5f0 Mon Sep 17 00:00:00 2001 From: Jan Kneschke Date: Wed, 17 Aug 2005 07:43:14 +0000 Subject: [PATCH] better error-handling and cleanup (merged [257] and [282]) git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@555 152afb58-edef-0310-8abb-c4023f1b3aa9 --- src/mod_evhost.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/mod_evhost.c b/src/mod_evhost.c index 44712ede..bc8adb63 100644 --- a/src/mod_evhost.c +++ b/src/mod_evhost.c @@ -45,10 +45,13 @@ FREE_FUNC(mod_evhost_free) { size_t i; for (i = 0; i < srv->config_context->used; i++) { plugin_config *s = p->config_storage[i]; + + if (!s) continue; if(s->path_pieces) { - for (i = 0; i < s->len; i++) { - buffer_free(s->path_pieces[i]); + size_t j; + for (j = 0; j < s->len; j++) { + buffer_free(s->path_pieces[j]); } free(s->path_pieces); @@ -264,6 +267,11 @@ static handler_t mod_evhost_uri_handler(server *srv, connection *con, void *p_d) mod_evhost_patch_connection(srv, con, p); + /* missing even default(global) conf */ + if (0 == p->conf.len) { + return HANDLER_GO_ON; + } + parsed_host = array_init(); mod_evhost_parse_host(con, parsed_host);