From f741a4aeb8606872dba203e2de58ea681065240d Mon Sep 17 00:00:00 2001 From: Wang Han <416810799@qq.com> Date: Mon, 27 Oct 2025 23:09:53 +0800 Subject: [PATCH] Free regex resources in plt_hook_commit Free regex resources for registered and ignored hooks before clearing the lists. --- native/src/core/zygisk/module.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/native/src/core/zygisk/module.cpp b/native/src/core/zygisk/module.cpp index dfb5e3788..5109ee473 100644 --- a/native/src/core/zygisk/module.cpp +++ b/native/src/core/zygisk/module.cpp @@ -208,6 +208,12 @@ bool ZygiskContext::plt_hook_commit() { { mutex_guard lock(hook_info_lock); plt_hook_process_regex(); + for (auto& reg: register_info) { + regfree(®.regex); + } + for (auto& ign: ignore_info) { + regfree(&ign.regex); + } register_info.clear(); ignore_info.clear(); }