mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
There isn't much point in having a free function if it isn't used.
Also allow a NULL tree.
This commit is contained in:
parent
ff4b4e667a
commit
abedfa77da
4
job.c
4
job.c
@ -107,6 +107,7 @@ job_add(struct jobs *jobs, struct client *c, const char *cmd,
|
||||
|
||||
job->flags = JOB_DONE;
|
||||
|
||||
if (jobs != NULL)
|
||||
RB_INSERT(jobs, jobs, job);
|
||||
SLIST_INSERT_HEAD(&all_jobs, job, lentry);
|
||||
|
||||
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user