aboutsummaryrefslogtreecommitdiff
path: root/src/net.c
diff options
context:
space:
mode:
authorame <[email protected]>2024-02-13 14:14:20 -0600
committerame <[email protected]>2024-02-13 14:14:20 -0600
commit0b28025b0b69266905a9f6235c7476bb799eea37 (patch)
tree4ca0fc810be6265be8c5ee00f592e64af8c8058e /src/net.c
parentd85b1d781655663ee52d180e0fb9abe7e476adf5 (diff)
idk
Diffstat (limited to 'src/net.c')
-rw-r--r--src/net.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/net.c b/src/net.c
index e39685b..c3239e5 100644
--- a/src/net.c
+++ b/src/net.c
@@ -397,6 +397,7 @@ void* handle_client(void *_arg){
void* v = parray_find(paths, aa->c);
+ str_free(aa);
if(v == NULL){
str* resp;
http_build(&resp, 404, "Not Found","text/html", "<h1>404</h1>");
@@ -461,7 +462,7 @@ void* handle_client(void *_arg){
}
}
}
- parray_lclear(owo);
+ parray_lclear(owo); //dont free the rest
lua_pushstring(L, "client_fd");
lua_gettable(L, res_idx);
@@ -471,7 +472,7 @@ void* handle_client(void *_arg){
}
- for(int i = 0; i != len; i++){
+ for(int i = 0; i != len * 2; i++){
str_free(table[i]);
}
free(table);
@@ -556,6 +557,7 @@ int start_serv(lua_State* L, int port){
pthread_create(&thread_id, NULL, handle_client, (void*)args);
pthread_detach(thread_id);
+ free(client_fd);
}
}