fix memleak

git-svn-id: file:///raid/svn-personal/tewi/trunk@74 8739d7e6-ffea-ec47-b151-bdff447c6205
This commit is contained in:
Nishi 2024-09-19 10:06:23 +00:00
parent 47fc157fd2
commit 647f50b9e0
2 changed files with 4 additions and 2 deletions

View File

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

View File

@ -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