From 48aa31c7a10798956b4cf664cba79e1a5619c977 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Thu, 15 Aug 2019 00:40:19 +0100 Subject: binds: Fix memory leak --- src/binds.c | 2 +- src/imv.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/binds.c b/src/binds.c index 07416cf..e6aea45 100644 --- a/src/binds.c +++ b/src/binds.c @@ -86,7 +86,7 @@ enum bind_result imv_binds_add(struct imv_binds *binds, const struct list *keys, /* Create our new node */ next_node = malloc(sizeof *next_node); init_bind_node(next_node); - next_node->key = keys->items[i]; + next_node->key = strdup(keys->items[i]); list_append(node->suffixes, next_node); } else { next_node = node->suffixes->items[child_index]; diff --git a/src/imv.c b/src/imv.c index d5c2c3c..27f0d6d 100644 --- a/src/imv.c +++ b/src/imv.c @@ -286,7 +286,7 @@ static bool add_bind(struct imv *imv, const char *keys, const char *commands) commands = next_command; } - list_free(list); + list_deep_free(list); return success; } -- cgit v1.2.3