diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-08-20 20:37:32 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2011-08-20 20:37:32 +0000 |
commit | 6fe1c41798303f63a4cd4e5dd3470d91e2a91fb9 (patch) | |
tree | 91b13f89c1c89782ebdcb00cb704f8c026bfa6bd /usr.bin/tmux | |
parent | fc3289d90f8133a3a0f3c1e730b310e661b15686 (diff) |
Fix a couple of memory leaks, from marcel partap.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/server-client.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/status.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 7a8e39a0c57..e43a11db1e0 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.60 2011/07/08 21:51:40 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.61 2011/08/20 20:37:30 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -171,6 +171,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/usr.bin/tmux/status.c b/usr.bin/tmux/status.c index e96200331ef..1507b4a63a8 100644 --- a/usr.bin/tmux/status.c +++ b/usr.bin/tmux/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.77 2011/07/08 06:37:57 nicm Exp $ */ +/* $OpenBSD: status.c,v 1.78 2011/08/20 20:37:31 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -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) { |