fix leaks

This commit is contained in:
van Hauser 2020-03-09 15:52:14 +01:00
parent 2f41663673
commit a24352ddfd
6 changed files with 10 additions and 0 deletions

View File

@ -1,5 +1,6 @@
#!/usr/bin/env sh
export AFL_QUIET=1
export ASAN_OPTIONS=detect_leaks=0
THISPATH=`dirname ${0}`
export PATH="${THISPATH}:$PATH"
awk -f - -- ${@+"$@"} <<'EOF'

View File

@ -887,3 +887,4 @@ static u64 next_p2(u64 val) {
}
#endif

View File

@ -178,3 +178,4 @@ static bool list_contains(list_t *list, void *contains_me) {
}
#endif

View File

@ -126,3 +126,4 @@ void afl_state_deinit(afl_state_t *afl) {
list_remove(&afl_states, afl);
}

View File

@ -1032,6 +1032,7 @@ int main(int argc, char** argv, char** envp) {
u8 child_timed_out = fsrv->child_timed_out;
afl_fsrv_deinit(fsrv);
free(fsrv);
if (stdin_file) ck_free(stdin_file);
exit(child_crashed * 2 + child_timed_out);

View File

@ -803,6 +803,8 @@ next_del_blksize:
finalize_all:
if (tmp_buf) ck_free(tmp_buf);
if (hang_mode) {
SAYF("\n" cGRA " File size reduced by : " cRST
@ -1350,7 +1352,10 @@ int main(int argc, char** argv, char** envp) {
afl_shm_deinit(&shm);
afl_fsrv_deinit(fsrv);
if (fsrv->out_file) ck_free(fsrv->out_file);
free(fsrv);
if (mask_bitmap) ck_free(mask_bitmap);
if (in_data) ck_free(in_data);
exit(0);