Skip to content

Fix quicksort temporary index buffer leak#1

Merged
amartinsmg merged 1 commit intomainfrom
codex/verify-algorithm-implementations
Feb 11, 2026
Merged

Fix quicksort temporary index buffer leak#1
amartinsmg merged 1 commit intomainfrom
codex/verify-algorithm-implementations

Conversation

@amartinsmg
Copy link
Owner

Motivation

  • Address a memory leak in quicksort where the dynamically allocated rangeIndexes buffer was not freed.

Description

  • Add free(rangeIndexes); at the end of quicksort in src/quicksort.hpp to release the temporary index buffer, leaving algorithm behavior unchanged.

Testing

  • Built and ran make test and ./debug/test (21 tests) which passed, and ran a randomized fuzz comparison against std::sort for all algorithms which also passed.

Codex Task

@amartinsmg amartinsmg merged commit 7406e3b into main Feb 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant