Skip to content

Commit

Permalink
Set binlog to NULL when copying a job
Browse files Browse the repository at this point in the history
job_copy is used for peek commands. The copy is only temporary
and should not hold a refcnt on binlog, so set to NULL
  • Loading branch information
gbarr committed Nov 27, 2008
1 parent 88a2f91 commit cfc2ddc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions job.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ job_copy(job j)
memcpy(n, j, sizeof(struct job) + j->body_size);
n->next = n->prev = n; /* not in a linked list */

n->binlog = NULL; /* copies do not have refcnt on the binlog */

n->tube = 0; /* Don't use memcpy for the tube, which we must refcount. */
TUBE_ASSIGN(n->tube, j->tube);

Expand Down

0 comments on commit cfc2ddc

Please sign in to comment.