Commit 783f7258 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Avoid crash when satisfying requests.

parent 11344b80
...@@ -161,11 +161,10 @@ satisfy_request(const unsigned char *prefix, unsigned char plen, ...@@ -161,11 +161,10 @@ satisfy_request(const unsigned char *prefix, unsigned char plen,
if(request->router_hash != router_hash || if(request->router_hash != router_hash ||
seqno_compare(request->seqno, seqno) <= 0) { seqno_compare(request->seqno, seqno) <= 0) {
if(previous == NULL) /* We cannot remove the request, as we may be walking the list right
to_resend = request->next; now. Mark it as expired, so that expire_resend will remove it. */
else request->max = 0;
previous->next = request->next; request->time.tv_sec = 0;
free(request);
recompute_resend_time(); recompute_resend_time();
return 1; return 1;
} }
......
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