Permalink
Browse files

Free only fake jobs.

If the job has an id, it is a "real" job and should only be freed by a
delete command.
  • Loading branch information...
1 parent 3427936 commit fe3256eb2f0527b991fcdbd7a42edbdff92be50b @kr committed Feb 23, 2009
Showing with 2 additions and 2 deletions.
  1. +1 −1 conn.c
  2. +1 −1 prot.c
View
2 conn.c
@@ -271,7 +271,7 @@ conn_close(conn c)
job_free(c->in_job);
/* was this a peek or stats command? */
- if (!has_reserved_this_job(c, c->out_job)) job_free(c->out_job);
+ if (c->out_job && !c->out_job->id) job_free(c->out_job);
c->in_job = c->out_job = NULL;
c->in_job_read = 0;
View
2 prot.c
@@ -1426,7 +1426,7 @@ reset_conn(conn c)
if (r == -1) return twarnx("update events failed"), conn_close(c);
/* was this a peek or stats command? */
- if (!has_reserved_this_job(c, c->out_job)) job_free(c->out_job);
+ if (c->out_job && !c->out_job->id) job_free(c->out_job);
c->out_job = NULL;
c->reply_sent = 0; /* now that we're done, reset this */

0 comments on commit fe3256e

Please sign in to comment.