mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-26 07:57:59 -04:00
config: fix cloning of env_vars tllist
When cloning a config struct, the env_vars tllist wasn't correctly copied. We did correctly iterate and duplicate all old entries, but we did *not* reset the list in the cloned struct before doing so. This meant the list contained entries shared with the original list, causing double free:s in --server mode.
This commit is contained in:
parent
a2283c8229
commit
208008d717
2 changed files with 4 additions and 0 deletions
|
|
@ -80,6 +80,8 @@
|
||||||
* Crash when using a desktop scaling factor > 1, on compositors that
|
* Crash when using a desktop scaling factor > 1, on compositors that
|
||||||
implements neither the `fractional-scale-v1`, nor the
|
implements neither the `fractional-scale-v1`, nor the
|
||||||
`cursor-shape-v1` Wayland protocols ([#1573][1573]).
|
`cursor-shape-v1` Wayland protocols ([#1573][1573]).
|
||||||
|
* Crash in `--server` mode when one or more environment variables are
|
||||||
|
set in `[environment]`.
|
||||||
|
|
||||||
[1531]: https://codeberg.org/dnkl/foot/issues/1531
|
[1531]: https://codeberg.org/dnkl/foot/issues/1531
|
||||||
[1573]: https://codeberg.org/dnkl/foot/issues/1573
|
[1573]: https://codeberg.org/dnkl/foot/issues/1573
|
||||||
|
|
|
||||||
2
config.c
2
config.c
|
|
@ -3393,6 +3393,8 @@ config_clone(const struct config *old)
|
||||||
key_binding_list_clone(&conf->bindings.url, &old->bindings.url);
|
key_binding_list_clone(&conf->bindings.url, &old->bindings.url);
|
||||||
key_binding_list_clone(&conf->bindings.mouse, &old->bindings.mouse);
|
key_binding_list_clone(&conf->bindings.mouse, &old->bindings.mouse);
|
||||||
|
|
||||||
|
conf->env_vars.length = 0;
|
||||||
|
conf->env_vars.head = conf->env_vars.tail = NULL;
|
||||||
tll_foreach(old->env_vars, it) {
|
tll_foreach(old->env_vars, it) {
|
||||||
struct env_var copy = {
|
struct env_var copy = {
|
||||||
.name = xstrdup(it->item.name),
|
.name = xstrdup(it->item.name),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue