aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-10-02 18:05:52 +0200
committeremersion <contact@emersion.fr>2017-10-03 08:46:10 +0200
commitc6866998173138d582a39a5ba59705fe1cb50b1a (patch)
tree5b75bbde5a9440b1d7ece00af3145eb8a21bc31a /rootston
parent517a709cddcdc5b5101cfefb7bec9d3c46ba10b0 (diff)
Free config->bindings
Diffstat (limited to 'rootston')
-rw-r--r--rootston/config.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/rootston/config.c b/rootston/config.c
index 49bb79fb..a80a8304 100644
--- a/rootston/config.c
+++ b/rootston/config.c
@@ -250,7 +250,7 @@ struct roots_config *parse_args(int argc, char *argv[]) {
wl_list_insert(&config->bindings, &bc->link);
bc->command = strdup("exit");
bc->keysyms_len = 2;
- bc->keysyms = calloc(1, sizeof(xkb_keysym_t));
+ bc->keysyms = calloc(1, bc->keysyms_len * sizeof(xkb_keysym_t));
bc->keysyms[0] = XKB_KEY_Meta_L;
bc->keysyms[1] = XKB_KEY_q;
} else if (result == -2) {
@@ -279,7 +279,12 @@ void roots_config_destroy(struct roots_config *config) {
free(dc);
}
- // TODO: free bindings
+ struct binding_config *bc, *btmp = NULL;
+ wl_list_for_each_safe(bc, btmp, &config->bindings, link) {
+ free(bc->keysyms);
+ free(bc->command);
+ free(bc);
+ }
free(config->config_path);
free(config->cursor.mapped_output);