summaryrefslogtreecommitdiffstats
path: root/key-bindings.c
diff options
context:
space:
mode:
authornicm <nicm>2021-08-23 11:04:21 +0000
committernicm <nicm>2021-08-23 11:04:21 +0000
commit4a753dbefc2e67c218cf41141eaa6afab00f774a (patch)
tree6a52781c86c30894be0e2161c31154b3bdf953a0 /key-bindings.c
parent3ed37a207988bc6e96dc673ae4564a4efd682ea6 (diff)
Fix a few memory leaks.
Diffstat (limited to 'key-bindings.c')
-rw-r--r--key-bindings.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/key-bindings.c b/key-bindings.c
index c0a959e2..e3b21d61 100644
--- a/key-bindings.c
+++ b/key-bindings.c
@@ -187,6 +187,7 @@ key_bindings_add(const char *name, key_code key, const char *note, int repeat,
{
struct key_table *table;
struct key_binding *bd;
+ char *s;
table = key_bindings_get_table(name, 1);
@@ -216,8 +217,10 @@ key_bindings_add(const char *name, key_code key, const char *note, int repeat,
bd->flags |= KEY_BINDING_REPEAT;
bd->cmdlist = cmdlist;
+ s = cmd_list_print(bd->cmdlist, 0);
log_debug("%s: %#llx %s = %s", __func__, bd->key,
- key_string_lookup_key(bd->key, 1), cmd_list_print(bd->cmdlist, 0));
+ key_string_lookup_key(bd->key, 1), s);
+ free(s);
}
void