Permalink
Browse files

Oops, ensure the copy gets freed.

In ca4b9a, I replaced a dangling pointer with a leak. Fix that leak by
marking the copy as a fake job (and thus okay to be freed), by setting
its id to 0.
  • Loading branch information...
1 parent 65cb78d commit d77814816f54c48b7bcc85c36bb681fd277d3e65 @kr committed Feb 25, 2009
Showing with 4 additions and 1 deletion.
  1. +4 −1 prot.c
View
5 prot.c
@@ -1391,7 +1391,10 @@ h_conn_timeout(conn c)
* the ready queue, someone might free it before we finish writing it
* out to the socket. So we'll copy it here and free the copy when it's
* done sending. */
- if (j == c->out_job) c->out_job = job_copy(c->out_job);
+ if (j == c->out_job) {
+ c->out_job = job_copy(c->out_job);
+ c->out_job->id = 0;
+ }
timeout_ct++; /* stats */
j->timeout_ct++;

0 comments on commit d778148

Please sign in to comment.