config: regex: fix invalid free

Zero-initialize the 'launch' spawn template before calling
value_to_spawn_template(). This is needed since
value_to_spawn_template() tries to free the old value before assigning
the new one.

Closes #1951
This commit is contained in:
Daniel Eklöf 2025-02-10 07:43:52 +01:00
parent d84b0d4c6a
commit 325086291b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1327,7 +1327,7 @@ parse_section_regex(struct context *ctx)
}
else if (streq(key, "launch")) {
struct config_spawn_template launch;
struct config_spawn_template launch = {NULL};
if (!value_to_spawn_template(ctx, &launch))
return false;