diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-04 12:58:43 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-04 12:58:43 -0500 |
commit | c8a2afef14d93d35a5cef27c02e9dc977495642b (patch) | |
tree | 83d66e54faa341ad7f778a67d9f3b60c6035c5a5 /src/environment.c | |
parent | 6e4b8bc37591cbc52e9eaacac31e897b428c0fef (diff) | |
download | stasis-c8a2afef14d93d35a5cef27c02e9dc977495642b.tar.gz |
Fix memory corruption in runtime_set and tpl_render
Diffstat (limited to 'src/environment.c')
-rw-r--r-- | src/environment.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) } /** |