Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the memory leak In recent request link list.
The add_log_csp() function is used to record recent request. The function store the request with a C++ style link chain. When the requests in the link chain get to the max_log_clients_count, function will remove the first link from the link chain, and here is the problem. The removal of the link action just change the pointer of the first link, so the memory of the old first link will be no reference anymore. The memory leak happens. With Instruments, you will find the leak track the memory on zalloc() in this function. What I do is just create a temporary reference for the first link that should be remove from the link chain, and free the memory after the old first link is removed. Without this memory leak, the thread should be running in a better situation.
- Loading branch information