Fixed memory leak in afl-fuzz-python.c - trim_case_python.

This commit is contained in:
n0p 2019-12-27 18:50:14 +01:00
parent 29bbe0aebe
commit cc3bf762ec

View File

@ -345,7 +345,10 @@ u8 trim_case_python(char** argv, struct queue_entry* q, u8* in_buf) {
fault = run_target(argv, exec_tmout);
++trim_execs;
if (stop_soon || fault == FAULT_ERROR) goto abort_trimming;
if (stop_soon || fault == FAULT_ERROR) {
free(retbuf);
goto abort_trimming;
}
cksum = hash32(trace_bits, MAP_SIZE, HASH_CONST);
@ -381,6 +384,8 @@ u8 trim_case_python(char** argv, struct queue_entry* q, u8* in_buf) {
}
free(retbuf);
/* Since this can be slow, update the screen every now and then. */
if (!(trim_exec++ % stats_update_freq)) show_stats();