diff --git a/compiler-rt/lib/profile/InstrProfilingWriter.c b/compiler-rt/lib/profile/InstrProfilingWriter.c index 3e90b1d496aa..95f37e8e9b4f 100644 --- a/compiler-rt/lib/profile/InstrProfilingWriter.c +++ b/compiler-rt/lib/profile/InstrProfilingWriter.c @@ -67,9 +67,9 @@ lprofCreateBufferIO(WriterCallback FileWriter, void *File) { COMPILER_RT_VISIBILITY void lprofDeleteBufferIO(ProfBufferIO *BufferIO) { if (DynamicBufferIOBuffer) { + FreeHook(DynamicBufferIOBuffer); DynamicBufferIOBuffer = 0; VPBufferSize = 0; - FreeHook(DynamicBufferIOBuffer); } }