Mettle

M0102Double free

Reported by the compiler as an error or warning.

mettle explain M0102

free is called twice on the same allocation along one path, which corrupts the allocator's bookkeeping.

Fix: free exactly once, typically at the single owner of the allocation. If two branches both free, hoist the free after the branches.

Related