chore: delete unused s2n_stuffer_alloc_ro functions#5757
Merged
WesleyRosenblum merged 3 commits intoaws:mainfrom Mar 4, 2026
Merged
chore: delete unused s2n_stuffer_alloc_ro functions#5757WesleyRosenblum merged 3 commits intoaws:mainfrom
WesleyRosenblum merged 3 commits intoaws:mainfrom
Conversation
Contributor
|
Hello @firedog1234, Thanks for contributing to s2n-tls! I have assigned reviewers for this PR. To get started, please fix those errors detected by our CI. Thanks! |
Contributor
|
From a quick check over of the codebase, it looks |
jmayclin
reviewed
Feb 23, 2026
Contributor
jmayclin
left a comment
There was a problem hiding this comment.
Already left this comment, but officially leaving a review so you can hit the re-request button.
From a quick check of the codebase, this code doesn't seem to be used.
s2n_stuffer_alloc_ro_from_fd is only ever called by s2n_stuffer_alloc_ro_from_file, and s2n_stuffer_alloc_ro_from_file isn't ever called.
In which case the best solution is to just delete the code 🙂
afe3751 to
b94766a
Compare
These functions use mmap() but never call munmap(), causing a memory leak. Since they are not used anywhere in the codebase, the best solution is to remove them entirely. Fixes aws#2147
b94766a to
9dede6e
Compare
WesleyRosenblum
approved these changes
Mar 4, 2026
jmayclin
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Goal
Remove the unused functions
s2n_stuffer_alloc_roands2n_stuffer_alloc_ro_from_fileWhy
s2n_stuffer_alloc_ro_from_fdusesmmap()to map a file into memory, but never callsmunmap()to unmap it when the stuffer is freed. We could fix this, but since the code is unused it is better to delete it.How
Callouts
Testing
Related
Fixes #2147