From c8a2afef14d93d35a5cef27c02e9dc977495642b Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Mon, 4 Mar 2024 12:58:43 -0500 Subject: Fix memory corruption in runtime_set and tpl_render --- src/environment.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/environment.c') diff --git a/src/environment.c b/src/environment.c index 7315281..391807f 100644 --- a/src/environment.c +++ b/src/environment.c @@ -284,9 +284,10 @@ char *runtime_expand_var(RuntimeEnv *env, char *input) { return NULL; } - // If there's no environment variables to process return a copy of the input string + // If there's no environment variables to process return the input string if (strchr(input, delim) == NULL) { - return strdup(input); + //return strdup(input); + return input; } expanded = calloc(OMC_BUFSIZ, sizeof(char)); @@ -417,7 +418,6 @@ void runtime_set(RuntimeEnv *env, const char *_key, char *_value) { } guard_free(now) guard_free(key) - guard_free(value) } /** -- cgit