Commit 7091888e authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Avoid reading freed memory.

parent 3c961c72
...@@ -134,12 +134,14 @@ expire_requests() ...@@ -134,12 +134,14 @@ expire_requests()
if(request->time < now.tv_sec - 60) { if(request->time < now.tv_sec - 60) {
if(previous == NULL) { if(previous == NULL) {
recorded_requests = request->next; recorded_requests = request->next;
free(request);
request = recorded_requests; request = recorded_requests;
} else { } else {
previous->next = request->next; previous->next = request->next;
free(request);
request = previous->next; request = previous->next;
} }
free(request); recompute = 1;
} else { } else {
request = request->next; request = request->next;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment