Memory is freed twice, corrupting the allocator's state.
Null pointers after free; adopt ownership-based memory management or memory-safe languages.