fix memory leak in check_main_node_exists

This commit is contained in:
Kuang-che Wu
2025-04-12 16:56:14 +00:00
parent aec90c7227
commit 4bd492f212

View File

@ -2227,10 +2227,17 @@ int check_main_node_exists(afl_state_t *afl) {
fn = alloc_printf("%s/%s/is_main_node", afl->sync_dir, sd_ent->d_name); fn = alloc_printf("%s/%s/is_main_node", afl->sync_dir, sd_ent->d_name);
int res = access(fn, F_OK); int res = access(fn, F_OK);
free(fn); free(fn);
if (res == 0) return 1; if (res == 0) {
closedir(sd);
return 1;
} }
}
closedir(sd);
return 0; return 0;
} }