Clean up routes

This commit is contained in:
kamkow1
2025-06-16 01:38:33 +02:00
parent a532d5b03d
commit 64ae8365b6
3 changed files with 69 additions and 68 deletions

3
main.c
View File

@ -63,6 +63,9 @@ void event_handler(struct mg_connection *conn, int ev, void *ev_data)
struct mg_str *data = (struct mg_str *)ev_data;
Route_Result *result = (Route_Result *)data->buf;
defer {
for (size_t i = 0; i < result->headers.count; i++) {
free(result->headers.items[i]);
}
list_free(&result->headers);
sb_free(&result->body);
}