mirror of https://github.com/xiph/flac
Remove files generated during fuzzing of flac tool
CI-Fuzz occassionally runs out of disk space, and there might be other problems (coverage suddenly vanishing for example) related to disk space issues. This commit should make sure all files generated by the flac tool are removed as soon as they are closed.
This commit is contained in:
parent
9bbdb6be6d
commit
5008827b64
|
@ -245,5 +245,8 @@ FLAC__bool dump_stats(const subframe_stats_t *stats, const char *filename)
|
|||
fprintf(outfile, "pause -1 'waiting...'\n");
|
||||
|
||||
fclose(outfile);
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
unlink(filename);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -297,7 +297,11 @@ void DecoderSession_destroy(DecoderSession *d, FLAC__bool error_occurred)
|
|||
}
|
||||
#endif
|
||||
fclose(d->fout);
|
||||
|
||||
#ifndef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
/* Always delete output file when fuzzing */
|
||||
if(error_occurred)
|
||||
#endif
|
||||
flac_unlink(d->outfilename);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1626,6 +1626,11 @@ int EncoderSession_finish_ok(EncoderSession *e, int info_align_carry, int info_a
|
|||
ret = 1;
|
||||
}
|
||||
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
/* Always delete output file when fuzzing */
|
||||
flac_unlink(e->outfilename);
|
||||
#endif
|
||||
|
||||
EncoderSession_destroy(e);
|
||||
|
||||
return ret;
|
||||
|
|
Loading…
Reference in New Issue