diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-10-11 07:30:08 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2009-10-11 07:30:08 +0000 |
commit | d4afc6a0539aeac9b14e30d260e508920f685565 (patch) | |
tree | 83f34ef058d49190af8b99ccd304286555579c84 /usr.bin/tmux/job.c | |
parent | f1fc569bca4807c7824360612bab64a0d7eb14c7 (diff) |
There isn't much point in having a free function if it isn't used.
Also allow a NULL tree.
Diffstat (limited to 'usr.bin/tmux/job.c')
-rw-r--r-- | usr.bin/tmux/job.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/tmux/job.c b/usr.bin/tmux/job.c index 23b183d4094..2e94e3b2961 100644 --- a/usr.bin/tmux/job.c +++ b/usr.bin/tmux/job.c @@ -1,4 +1,4 @@ -/* $OpenBSD: job.c,v 1.3 2009/10/11 07:20:16 nicm Exp $ */ +/* $OpenBSD: job.c,v 1.4 2009/10/11 07:30:07 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -107,7 +107,8 @@ job_add(struct jobs *jobs, struct client *c, const char *cmd, job->flags = JOB_DONE; - RB_INSERT(jobs, jobs, job); + if (jobs != NULL) + RB_INSERT(jobs, jobs, job); SLIST_INSERT_HEAD(&all_jobs, job, lentry); return (job); @@ -121,6 +122,9 @@ job_free(struct job *job) xfree(job->cmd); + if (job->freefn != NULL && job->data != NULL) + job->freefn(job->data); + if (job->fd != -1) close(job->fd); if (job->out != NULL) |