Prevent possible memory leaks by freeing log header memory.