Always initialize module_list

Close #5712
This commit is contained in:
topjohnwu 2022-05-06 01:40:19 -07:00
parent cffd024e9e
commit 90545057e9
2 changed files with 25 additions and 27 deletions

View File

@ -391,6 +391,7 @@ static void daemon_entry() {
default_new(poll_map); default_new(poll_map);
default_new(poll_fds); default_new(poll_fds);
default_new(module_list);
// Register handler for main socket // Register handler for main socket
pollfd main_socket_pfd = { fd, POLLIN, 0 }; pollfd main_socket_pfd = { fd, POLLIN, 0 };

View File

@ -583,7 +583,6 @@ void magic_mount() {
char buf[4096]; char buf[4096];
LOGI("* Loading modules\n"); LOGI("* Loading modules\n");
if (module_list) {
for (const auto &m : *module_list) { for (const auto &m : *module_list) {
const char *module = m.name.data(); const char *module = m.name.data();
char *b = buf + sprintf(buf, "%s/" MODULEMNT "/%s/", MAGISKTMP.data(), module); char *b = buf + sprintf(buf, "%s/" MODULEMNT "/%s/", MAGISKTMP.data(), module);
@ -611,7 +610,6 @@ void magic_mount() {
system->collect_files(module, fd); system->collect_files(module, fd);
close(fd); close(fd);
} }
}
if (MAGISKTMP != "/sbin") { if (MAGISKTMP != "/sbin") {
// Need to inject our binaries into /system/bin // Need to inject our binaries into /system/bin
inject_magisk_bins(system); inject_magisk_bins(system);
@ -768,7 +766,6 @@ static void collect_modules(bool open_zygisk) {
} }
void handle_modules() { void handle_modules() {
default_new(module_list);
prepare_modules(); prepare_modules();
collect_modules(false); collect_modules(false);
exec_module_scripts("post-fs-data"); exec_module_scripts("post-fs-data");