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:
ThePedroo
2025-04-25 02:05:29 -03:00
parent 2f4f5af206
commit aac0046061
2 changed files with 4 additions and 4 deletions

View File

@@ -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);

View File

@@ -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(