Commit 087ad7f
committed
Fix: Free
Both intersect implementations allocated the linear-probing hash table
via `alloc->allocate(...)` at function entry but never released it on
the success path, leaking `hash_table_slots * (sizeof(sz_size_t) +
sizeof(sz_u64_t))` bytes per call. LeakSanitizer flagged this as 6
direct leaks (~50 KiB total) in `test_intersecting_algorithms`. Add the
missing `alloc->free(...)` before the final `return sz_success_k;` in
each function. The `sz_bad_alloc_k` early return needs no free since
the allocation itself failed.table_positions in sz_sequence_intersect_serial and _ice
1 parent a3926e2 commit 087ad7f
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
339 | 339 | | |
340 | 340 | | |
341 | 341 | | |
| 342 | + | |
342 | 343 | | |
343 | 344 | | |
344 | 345 | | |
| |||
721 | 722 | | |
722 | 723 | | |
723 | 724 | | |
| 725 | + | |
724 | 726 | | |
725 | 727 | | |
726 | 728 | | |
| |||
0 commit comments