mirror of
https://github.com/fosrl/gerbil.git
synced 2026-03-22 12:54:30 -05:00
[PR #38] fix: relay buffer leak on UDP read error #37
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/gerbil/pull/38
Author: @LaurenceJJones
Created: 11/16/2025
Status: 🔄 Open
Base:
main← Head:fix/relay-buffer-leak📝 Commits (1)
b2392fbrelay: fix buffer leak on UDP read error by returning buffer to pool📊 Changes
1 file changed (+2 additions, -0 deletions)
View changed files
📝
relay/relay.go(+2 -0)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
When ReadFromUDP fails in readPackets, the buffer was not returned to the sync.Pool, causing a small but persistent leak under error conditions. Return the buffer before continuing to ensure reuse and stable memory.
Scope: minimal hotfix (no broader refactors) based on my other branch that extensively updated relay.go
How to test?
Difficult but on error the buffer should be placed back into the pool instead of silently leaking as the sync.Pool cannot track its lifecycle as under error it believes the buffer is in use.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.