Fix memory leaks for jobs.

Free the data memory of process and pipe handles in the close callback
for a job.
This commit is contained in:
oni-link 2014-07-23 13:52:15 +02:00
parent bb1f08f6e8
commit e9e4cdb3d4

View File

@ -402,6 +402,14 @@ static void close_cb(uv_handle_t *handle)
rstream_free(job->out);
rstream_free(job->err);
wstream_free(job->in);
// Free data memory of process and pipe handles, that was allocated
// by handle_set_job in job_start.
free(job->proc.data);
free(job->proc_stdin.data);
free(job->proc_stdout.data);
free(job->proc_stderr.data);
shell_free_argv(job->proc_opts.args);
free(job);
}