Fix leaks when stopping afl
MODIFY
src/afl-common.c
src/afl-common.c
@@ -156,6 +156,7 @@ char** get_qemu_argv(u8* own_loc, char** argv, int argc) {
if (!access(BIN_PATH "/afl-qemu-trace", X_OK)) {
+ ck_free(cp);
target_path = new_argv[0] = ck_strdup(BIN_PATH "/afl-qemu-trace");
return new_argv;

MODIFY
src/afl-fuzz-run.c
src/afl-fuzz-run.c
@@ -643,7 +643,7 @@ void sync_fuzzers(char** argv) {
fault = run_target(argv, exec_tmout);
- if (stop_soon) return;
+ if (stop_soon) goto close_sync;
syncing_party = sd_ent->d_name;
queued_imported += save_if_interesting(argv, mem, st.st_size, fault);
@@ -662,6 +662,7 @@ void sync_fuzzers(char** argv) {
ck_write(id_fd, &next_min_accept, sizeof(u32), qd_synced_path);
+close_sync:
close(id_fd);
closedir(qd);
ck_free(qd_path);

Fix leaks when stopping afl (#228)