aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Barnes <craigbarnes@protonmail.com>2021-11-20 15:12:56 +0000
committerCraig Barnes <craigbarnes@protonmail.com>2021-11-20 15:12:56 +0000
commit0db125a1253d2daa33d94c7f1a50b22eeb176be3 (patch)
tree5bf4cb75a85dbb91f107810feb23cd558eaca7ca
parentci: one more text-shaping -> grapheme-shaping+run-shaping (diff)
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.
-rw-r--r--config.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/config.c b/config.c
index 2f12e201..50306b9d 100644
--- a/config.c
+++ b/config.c
@@ -614,6 +614,7 @@ value_to_enum(struct context *ctx, const char **value_map, int *res)
valid_values[idx - 2] = '\0';
LOG_CONTEXTUAL_ERR("not one of %s", valid_values);
+ free(valid_values);
*res = -1;
return false;
}