You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
fix: memory leak in rezygisk_get_info
This commit fixes a memory leak in "rezygisk_get_info" as it would read a string from ReZygiskd but would never "free" after using it. Also call "free_rezygisk_info" instead of manually cleanup in ptracer.
This commit is contained in:
@@ -149,6 +149,8 @@ void rezygiskd_get_info(struct rezygisk_info *info) {
|
||||
char module_path[PATH_MAX];
|
||||
snprintf(module_path, sizeof(module_path), "/data/adb/modules/%s/module.prop", module_name);
|
||||
|
||||
free(module_name);
|
||||
|
||||
FILE *module_prop = fopen(module_path, "r");
|
||||
if (!module_prop) {
|
||||
PLOGE("failed to open module prop file %s", module_path);
|
||||
|
||||
@@ -82,15 +82,13 @@ int main(int argc, char **argv) {
|
||||
|
||||
for (size_t i = 0; i < info.modules->modules_count; i++) {
|
||||
printf(" - %s\n", info.modules->modules[i]);
|
||||
|
||||
free(info.modules->modules[i]);
|
||||
}
|
||||
|
||||
free(info.modules->modules);
|
||||
} else {
|
||||
printf("Modules: N/A\n");
|
||||
}
|
||||
|
||||
free_rezygisk_info(&info);
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
printf(
|
||||
|
||||
Reference in New Issue
Block a user