summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-unbind-key.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2010-01-23 17:50:57 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2010-01-23 17:50:57 +0000
commit4093a64aeed5e515963f8a03f78ba6a880363ac6 (patch)
treece9792a5d96aefd3beda316f988cc8f9de94e6e0 /usr.bin/tmux/cmd-unbind-key.c
parent05ebff4687ac806b92ee30ddc9c41bbb4a82a28b (diff)
Don't leak if arguments appear multiple times, from Tiago Cunha.
Diffstat (limited to 'usr.bin/tmux/cmd-unbind-key.c')
-rw-r--r--usr.bin/tmux/cmd-unbind-key.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-unbind-key.c b/usr.bin/tmux/cmd-unbind-key.c
index b278bb0c2f7..5677f0867a5 100644
--- a/usr.bin/tmux/cmd-unbind-key.c
+++ b/usr.bin/tmux/cmd-unbind-key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-unbind-key.c,v 1.6 2009/11/13 19:53:29 nicm Exp $ */
+/* $OpenBSD: cmd-unbind-key.c,v 1.7 2010/01/23 17:50:56 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -67,7 +67,8 @@ cmd_unbind_key_parse(struct cmd *self, int argc, char **argv, char **cause)
no_prefix = 1;
break;
case 't':
- data->tablename = xstrdup(optarg);
+ if (data->tablename == NULL)
+ data->tablename = xstrdup(optarg);
break;
default:
goto usage;