summaryrefslogtreecommitdiffstats
path: root/key-bindings.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-06-16 07:01:41 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-06-16 07:01:41 +0000
commit4c166484f4c718ecd57f6b8a9fe7958d09c93900 (patch)
tree209aa8e0275a8fc472f1c57d3f2436fb9e94a598 /key-bindings.c
parenta8e3e989dd6aba29033084662efdad8c71b86ca3 (diff)
Memory leak/missing init.
Diffstat (limited to 'key-bindings.c')
-rw-r--r--key-bindings.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/key-bindings.c b/key-bindings.c
index 7a0d812e..1c936d20 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -1,4 +1,4 @@
-/* $Id: key-bindings.c,v 1.29 2008-06-05 16:35:32 nicm Exp $ */
+/* $Id: key-bindings.c,v 1.30 2008-06-16 07:01:41 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -44,7 +44,8 @@ key_bindings_add(int key, struct cmd *cmd)
if (i == ARRAY_LENGTH(&key_bindings)) {
bd = xmalloc(sizeof *bd);
ARRAY_ADD(&key_bindings, bd);
- }
+ } else
+ cmd_free(bd->cmd);
bd->key = key;
bd->cmd = cmd;