From 4e98093d6cc8d9e4874eb975c598775eda33d854 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sun, 30 Oct 2022 09:03:24 +0300 Subject: [PATCH] Fix crash when removing all scripts --- src/scripts.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/scripts.cc b/src/scripts.cc index d5bf37c..ddb3ac5 100644 --- a/src/scripts.cc +++ b/src/scripts.cc @@ -2354,6 +2354,11 @@ int _scr_remove_all() } else { next = scriptListExtent->next; scriptRemove(script->sid); + + // CE: Current extent is freed in |scriptRemove|. Break + // to prevent next iteration which needs to dereference + // extent to obtain it's length. + break; } } }