aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--server-client.c2
-rw-r--r--status.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/server-client.c b/server-client.c
index badbe1be..6ed53b8a 100644
--- a/server-client.c
+++ b/server-client.c
@@ -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);
diff --git a/status.c b/status.c
index 04669849..1baab922 100644
--- a/status.c
+++ b/status.c
@@ -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) {