Sync OpenBSD patchset 947:

Fix a couple of memory leaks, from marcel partap.
pull/1/head
Tiago Cunha 2011-08-21 12:39:34 +00:00
parent 87a2a13f68
commit 2651c0d69c
2 changed files with 5 additions and 1 deletions

View File

@ -170,6 +170,8 @@ server_client_lost(struct client *c)
if (c->cwd != NULL)
xfree(c->cwd);
environ_free(&c->environ);
close(c->ibuf.fd);
imsg_clear(&c->ibuf);
event_del(&c->event);

View File

@ -551,8 +551,10 @@ status_find_job(struct client *c, char **iptr)
/* First try in the new tree. */
so_find.cmd = cmd;
so = RB_FIND(status_out_tree, &c->status_new, &so_find);
if (so != NULL && so->out != NULL)
if (so != NULL && so->out != NULL) {
xfree(cmd);
return (so->out);
}
/* If not found at all, start the job and add to the tree. */
if (so == NULL) {