aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-10-12 00:22:17 +0000
committerTiago Cunha <tcunha@gmx.com>2009-10-12 00:22:17 +0000
commitc8d0608369971b7f80d89961fed4ae3d80eb449b (patch)
treef35a4e0fb4e334d0bfa8cfb092dc7f45d0144de6
parent1b03bc2404a0892b9434b43603fc43282e6e36de (diff)
downloadrtmux-c8d0608369971b7f80d89961fed4ae3d80eb449b.tar.gz
rtmux-c8d0608369971b7f80d89961fed4ae3d80eb449b.tar.bz2
rtmux-c8d0608369971b7f80d89961fed4ae3d80eb449b.zip
Sync OpenBSD patchset 383:
There isn't much point in having a free function if it isn't used. Also allow a NULL tree.
-rw-r--r--job.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/job.c b/job.c
index 1bb21067..14754693 100644
--- a/job.c
+++ b/job.c
@@ -1,4 +1,4 @@
-/* $Id: job.c,v 1.4 2009-10-12 00:21:08 tcunha Exp $ */
+/* $Id: job.c,v 1.5 2009-10-12 00:22:17 tcunha Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -106,7 +106,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);
@@ -120,6 +121,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)