diff options
| author | Philipp Stephani | 2020-11-29 21:13:02 +0100 |
|---|---|---|
| committer | Philipp Stephani | 2020-11-29 21:13:02 +0100 |
| commit | 41c338474dd1e086494337fd18ec8828cef1a75c (patch) | |
| tree | 31e090e26e3bda495f984c0a634e21cfe0ecf0ce /src | |
| parent | 367727b0f6ed2468c909b9883740bff101d5a68f (diff) | |
| download | emacs-41c338474dd1e086494337fd18ec8828cef1a75c.tar.gz emacs-41c338474dd1e086494337fd18ec8828cef1a75c.zip | |
Fix double-free bug when finalizing module runtimes.
* src/emacs-module.c (finalize_runtime_unwind): Don't finalize initial
environment twice.
* test/src/emacs-module-resources/mod-test.c (emacs_module_init):
Allocate lots of values during module initialization to trigger the
bug.
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs-module.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c index 5f97815ec15..0f3ef59fd8c 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c | |||
| @@ -1506,8 +1506,8 @@ finalize_environment_unwind (void *env) | |||
| 1506 | void | 1506 | void |
| 1507 | finalize_runtime_unwind (void *raw_ert) | 1507 | finalize_runtime_unwind (void *raw_ert) |
| 1508 | { | 1508 | { |
| 1509 | struct emacs_runtime *ert = raw_ert; | 1509 | /* No further cleanup is required, as the initial environment is |
| 1510 | finalize_environment (ert->private_members->env); | 1510 | unwound separately. See the logic in Fmodule_load. */ |
| 1511 | } | 1511 | } |
| 1512 | 1512 | ||
| 1513 | 1513 | ||