diff options
author | Lukas Larsson <[email protected]> | 2018-06-11 15:22:00 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2018-06-11 15:22:00 +0200 |
commit | 558f6498f51242f2a668bae08b0bfff41f591bf4 (patch) | |
tree | 69b5c857d33b4a944c809563c8e1942c0b4c8149 /erts | |
parent | 0e9d90f6925fe6b4284908638fefe0e1f4e2419c (diff) | |
parent | 35fb6f2e11db0454c634772137f748dc81bcca63 (diff) | |
download | otp-558f6498f51242f2a668bae08b0bfff41f591bf4.tar.gz otp-558f6498f51242f2a668bae08b0bfff41f591bf4.tar.bz2 otp-558f6498f51242f2a668bae08b0bfff41f591bf4.zip |
filmor/use-after-free-escript-win32/PR-1826/OTP-15119
Fix use-after-free on Windows in escript
Diffstat (limited to 'erts')
-rw-r--r-- | erts/etc/common/escript.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/erts/etc/common/escript.c b/erts/etc/common/escript.c index d739d21f12..c84e63ad7c 100644 --- a/erts/etc/common/escript.c +++ b/erts/etc/common/escript.c @@ -139,15 +139,6 @@ get_env(char *key) } static void -free_env_val(char *value) -{ -#ifdef __WIN32__ - if (value) - efree(value); -#endif -} - -static void set_env(char *key, char *value) { #ifdef __WIN32__ @@ -422,7 +413,6 @@ main(int argc, char** argv) int eargv_size; int eargc_base; /* How many arguments in the base of eargv. */ char* emulator; - char* env; char* basename; char* def_emu_lookup_path; char scriptname[PMAX]; @@ -504,7 +494,7 @@ main(int argc, char** argv) } /* Determine path to emulator */ - emulator = env = get_env("ESCRIPT_EMULATOR"); + emulator = get_env("ESCRIPT_EMULATOR"); if (emulator == NULL) { emulator = get_default_emulator(def_emu_lookup_path); @@ -518,7 +508,6 @@ main(int argc, char** argv) */ PUSH(emulator); - free_env_val(env); PUSH("+B"); PUSH2("-boot", "no_dot_erlang"); |