summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-08-28 13:16:04 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-08-28 13:16:04 +0000
commit50c0f60bdcf9c4dda90612592d68f98077a05a71 (patch)
tree84ca6d0e0187559b2f80445833cfe0cf00a20b6f /usr.bin
parenteffd5cf2561114fdc31f69435c049ea8bb45b740 (diff)
Don't leak name when freeing session, from Kuang-che Wu.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/tmux/session.c b/usr.bin/tmux/session.c
index fe746303fc7..fb3b827dbd5 100644
--- a/usr.bin/tmux/session.c
+++ b/usr.bin/tmux/session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: session.c,v 1.52 2015/08/28 13:12:20 nicm Exp $ */
+/* $OpenBSD: session.c,v 1.53 2015/08/28 13:16:03 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -189,8 +189,10 @@ session_free(unused int fd, unused short events, void *arg)
log_debug("sesson %s freed (%d references)", s->name, s->references);
- if (s->references == 0)
+ if (s->references == 0) {
+ free(s->name);
free(s);
+ }
}
/* Destroy a session. */