]> Nishi Git Mirror - tewi.git/commitdiff
fix memleak
authorNishi <nishi@nishi.boats>
Thu, 19 Sep 2024 10:06:23 +0000 (10:06 +0000)
committerNishi <nishi@nishi.boats>
Thu, 19 Sep 2024 10:06:23 +0000 (10:06 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@74 8739d7e6-ffea-ec47-b151-bdff447c6205

Server/server.c
example.conf

index fc3a11cf627484bbb1f5440ead6b00bd90942a91..d0b4963edf9bc3178136597f5a97d42aaf0ddaf0 100644 (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;
index 3a63a026638028fc08b62e56c8c542b81258cba2..4dc759101b833b51dd2dae07e000b5f20285cb67 100644 (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