mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
config: fix memory leak in value_to_enum()
This could be triggered by running, for example:
foot -o tweak.render-timer=invalid
For some reason LeakSanitizer was only detecting this leak when the
option value was invalid, even though it was occuring in either case.
This commit is contained in:
parent
37b82efa77
commit
0db125a125
1 changed files with 1 additions and 0 deletions
1
config.c
1
config.c
|
|
@ -614,6 +614,7 @@ value_to_enum(struct context *ctx, const char **value_map, int *res)
|
||||||
valid_values[idx - 2] = '\0';
|
valid_values[idx - 2] = '\0';
|
||||||
|
|
||||||
LOG_CONTEXTUAL_ERR("not one of %s", valid_values);
|
LOG_CONTEXTUAL_ERR("not one of %s", valid_values);
|
||||||
|
free(valid_values);
|
||||||
*res = -1;
|
*res = -1;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue