diff options
author | Harry Jeffery <harry@exec64.co.uk> | 2019-08-15 00:40:19 +0100 |
---|---|---|
committer | Harry Jeffery <harry@exec64.co.uk> | 2019-08-15 00:40:19 +0100 |
commit | 48aa31c7a10798956b4cf664cba79e1a5619c977 (patch) | |
tree | ac63a53e22c8e6bc8e1cf7abc5b68c8e8b447905 | |
parent | 4db590c0d02bce840f6ff87031aeed6f24cc06d5 (diff) | |
download | imv-48aa31c7a10798956b4cf664cba79e1a5619c977.tar.gz |
binds: Fix memory leak
-rw-r--r-- | src/binds.c | 2 | ||||
-rw-r--r-- | src/imv.c | 2 |
2 files changed, 2 insertions, 2 deletions
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]; @@ -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; } |