fix memory leaks

This commit is contained in:
Kuang-che Wu
2025-04-13 03:06:06 +00:00
parent 4bd492f212
commit e305bc15d3
2 changed files with 10 additions and 1 deletions

View File

@ -867,7 +867,14 @@ void sync_fuzzers(afl_state_t *afl) {
fault = fuzz_run_target(afl, &afl->fsrv, afl->fsrv.exec_tmout);
if (afl->stop_soon) { goto close_sync; }
if (afl->stop_soon) {
munmap(mem, st.st_size);
close(fd);
goto close_sync;
}
afl->syncing_party = sd_ent->d_name;
afl->queued_imported += save_if_interesting(afl, mem, new_len, fault);

View File

@ -762,6 +762,8 @@ void afl_state_deinit(afl_state_t *afl) {
afl_free(afl->in_buf);
afl_free(afl->in_scratch_buf);
afl_free(afl->ex_buf);
afl_free(afl->alias_table);
afl_free(afl->alias_probability);
ck_free(afl->virgin_bits);
ck_free(afl->virgin_tmout);