free memory when shutdown

With this fix, ASAN_BUILD won't report leaks if ctrl-c (in a short run).
This commit is contained in:
Kuang-che Wu
2025-04-12 09:27:59 +00:00
parent 57fa87ce5e
commit 9513397336
2 changed files with 6 additions and 0 deletions

View File

@ -766,6 +766,7 @@ void destroy_queue(afl_state_t *afl) {
for (i = 0; i < afl->queued_items; i++) {
q = afl->queue_buf[i];
ck_free(q->testcase_buf);
ck_free(q->fname);
ck_free(q->trace_mini);
if (q->skipdet_e) {

View File

@ -773,6 +773,11 @@ void afl_state_deinit(afl_state_t *afl) {
ck_free(afl->first_trace);
ck_free(afl->map_tmp_buf);
ck_free(afl->skipdet_g->inf_prof);
ck_free(afl->skipdet_g->virgin_det_bits);
ck_free(afl->skipdet_g);
ck_free(afl->havoc_prof);
list_remove(&afl_states, afl);
}