From: Nishi Date: Thu, 19 Sep 2024 10:06:23 +0000 (+0000) Subject: fix memleak X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=647f50b9e06d08b804a909a63d0d2e439b87f8c2;p=tewi.git fix memleak git-svn-id: file:///raid/svn-personal/tewi/trunk@74 8739d7e6-ffea-ec47-b151-bdff447c6205 --- diff --git a/Server/server.c b/Server/server.c index fc3a11c..d0b4963 100644 --- a/Server/server.c +++ b/Server/server.c @@ -345,6 +345,7 @@ void addstring(char** str, const char* add, ...) { free(tmp); } } + va_end(va); } char* tw_get_mime(const char* ext, struct tw_config_entry* vhost_entry) { @@ -544,6 +545,7 @@ void tw_server_pass(int sock, bool ssl, int port, SOCKADDR addr) { char* mime = tw_get_mime(ext, vhost_entry); tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, 0, 0); fclose(f); + if(ext != NULL) free(ext); free(p); found = true; break; diff --git a/example.conf b/example.conf index 3a63a02..4dc7591 100644 --- a/example.conf +++ b/example.conf @@ -1,7 +1,7 @@ # $Id$ # This is an example config -LoadModule /home/nishi/SVN/tewi/trunk/Module/mod_cgi.so +#LoadModule /home/nishi/SVN/tewi/trunk/Module/mod_cgi.so Listen 80 ListenSSL 443 @@ -31,5 +31,5 @@ BeginDirectory / EndDirectory BeginDirectory /var/www/cgi-bin - AllowCGI +# AllowCGI EndDirectory