Skip to content

Commit

Permalink
Free only fake jobs.
Browse files Browse the repository at this point in the history
If the job has an id, it is a "real" job and should only be freed by a
delete command.
  • Loading branch information
kr committed Feb 23, 2009
1 parent 3427936 commit fe3256e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion prot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit fe3256e

Please sign in to comment.