mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-05-03 06:46:42 -04:00
config: fix memory leak on e.g. "not a valid XKB key name" errors
This commit is contained in:
parent
846271e8d3
commit
43206e6601
1 changed files with 4 additions and 5 deletions
9
config.c
9
config.c
|
|
@ -1928,7 +1928,8 @@ value_to_key_combos(struct context *ctx, int action,
|
||||||
if (idx == 0) {
|
if (idx == 0) {
|
||||||
LOG_CONTEXTUAL_ERR(
|
LOG_CONTEXTUAL_ERR(
|
||||||
"empty binding not allowed (set to 'none' to unmap)");
|
"empty binding not allowed (set to 'none' to unmap)");
|
||||||
goto err;
|
free(copy);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
remove_from_key_bindings_list(bindings, action, aux);
|
remove_from_key_bindings_list(bindings, action, aux);
|
||||||
|
|
@ -1946,10 +1947,8 @@ value_to_key_combos(struct context *ctx, int action,
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
if (idx > 0) {
|
for (size_t i = 0; i < used_combos; i++)
|
||||||
for (size_t i = 0; i < used_combos; i++)
|
free_key_binding(&new_combos[i]);
|
||||||
free_key_binding(&new_combos[i]);
|
|
||||||
}
|
|
||||||
free(copy);
|
free(copy);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue