mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
config: don't try to free key combos we haven't allocated
When erroring out due to a key combo being "empty", we incorrectly tried to free one key binding. This is because 'used_combos' is initialized to '1'. And it should, but an empty key binding is a special case. Fixes a test failure, and closes #1620
This commit is contained in:
parent
a5ab490380
commit
3d9aa1c29c
1 changed files with 4 additions and 2 deletions
6
config.c
6
config.c
|
|
@ -1823,8 +1823,10 @@ value_to_key_combos(struct context *ctx, int action,
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
for (size_t i = 0; i < used_combos; i++)
|
if (idx > 0) {
|
||||||
free_key_binding(&new_combos[i]);
|
for (size_t i = 0; i < used_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