X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/80fea873648ca2ab2e592999a336c59cf054ab55..0b049796b89a59fc322119b54199d92c404ef687:/src/src/setenv.c diff --git a/src/src/setenv.c b/src/src/setenv.c index ceeb8ef1c..90e679304 100644 --- a/src/src/setenv.c +++ b/src/src/setenv.c @@ -17,7 +17,7 @@ setenv(const char * name, const char * val, int overwrite) uschar * s; if (Ustrchr(name, '=')) return -1; if (overwrite || !getenv(name)) - putenv(CS string_copy_malloc(string_sprintf("%s=%s", name, val))); + putenv(CS string_copy_perm(string_sprintf("%s=%s", name, val), FALSE)); return 0; } @@ -26,7 +26,6 @@ unsetenv(const char *name) { size_t len; const char * end; -char ** e; extern char ** environ; if (!name) @@ -44,7 +43,7 @@ len = end - name; /* Find name in environment and move remaining variables down. Do not early-out in case there are duplicate names. */ -for (e = environ; *e; e++) +for (char ** e = environ; *e; e++) if (strncmp(*e, name, len) == 0 && (*e)[len] == '=') { char ** sp = e;