summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-07-30 20:41:49 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-07-30 20:41:49 +0000
commit344c6cad5042ee9488e7fe232035880bf95ab952 (patch)
tree10329bc70a8f23a0dd94ff0f434d74884f7817ed /usr.bin
parenta8768281c993f0c711aec708d76d13c65ffc1949 (diff)
Plug some memory leaks.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/mode-key.c3
-rw-r--r--usr.bin/tmux/screen-write.c3
-rw-r--r--usr.bin/tmux/screen.c4
-rw-r--r--usr.bin/tmux/status.c3
4 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/tmux/mode-key.c b/usr.bin/tmux/mode-key.c
index 74ec7f7e554..2d8e4ac02e7 100644
--- a/usr.bin/tmux/mode-key.c
+++ b/usr.bin/tmux/mode-key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mode-key.c,v 1.11 2009/07/28 17:05:10 nicm Exp $ */
+/* $OpenBSD: mode-key.c,v 1.12 2009/07/30 20:41:48 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -337,6 +337,7 @@ mode_key_free_trees(void)
while (!SPLAY_EMPTY(mtab->tree)) {
mbind = SPLAY_ROOT(mtab->tree);
SPLAY_REMOVE(mode_key_tree, mtab->tree, mbind);
+ xfree(mbind);
}
}
}
diff --git a/usr.bin/tmux/screen-write.c b/usr.bin/tmux/screen-write.c
index 44e3d230743..fcf2c8170c1 100644
--- a/usr.bin/tmux/screen-write.c
+++ b/usr.bin/tmux/screen-write.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen-write.c,v 1.18 2009/07/27 11:33:21 nicm Exp $ */
+/* $OpenBSD: screen-write.c,v 1.19 2009/07/30 20:41:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -91,6 +91,7 @@ screen_write_strlen(int utf8flag, const char *fmt, ...)
}
}
+ xfree(msg);
return (size);
}
diff --git a/usr.bin/tmux/screen.c b/usr.bin/tmux/screen.c
index 0f78ad76439..385f88c69b3 100644
--- a/usr.bin/tmux/screen.c
+++ b/usr.bin/tmux/screen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: screen.c,v 1.9 2009/07/17 18:35:11 nicm Exp $ */
+/* $OpenBSD: screen.c,v 1.10 2009/07/30 20:41:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -63,6 +63,8 @@ screen_reinit(struct screen *s)
void
screen_free(struct screen *s)
{
+ if (s->tabs != NULL)
+ xfree(s->tabs);
xfree(s->title);
grid_destroy(s->grid);
}
diff --git a/usr.bin/tmux/status.c b/usr.bin/tmux/status.c
index 1f78c5dd9ed..46702b19f4e 100644
--- a/usr.bin/tmux/status.c
+++ b/usr.bin/tmux/status.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: status.c,v 1.21 2009/07/28 07:03:32 nicm Exp $ */
+/* $OpenBSD: status.c,v 1.22 2009/07/30 20:41:48 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -801,6 +801,7 @@ status_prompt_key(struct client *c, int key)
memcpy(first, s, strlen(s));
c->prompt_index = (first - c->prompt_buffer) + strlen(s);
+ xfree(s);
c->flags |= CLIENT_STATUS;
break;