Free regex resources in plt_hook_commit

Free regex resources for registered and ignored hooks before clearing the lists.
This commit is contained in:
Wang Han
2025-10-27 23:09:53 +08:00
committed by John Wu
parent 4ee2235961
commit f741a4aeb8

View File

@@ -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(&reg.regex);
}
for (auto& ign: ignore_info) {
regfree(&ign.regex);
}
register_info.clear();
ignore_info.clear();
}