mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[PR #5202] [MERGED] fix: close connections on error paths to prevent resource leaks #5168
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#5168
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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/fatedier/frp/pull/5202
Author: @fatedier
Created: 3/6/2026
Status: ✅ Merged
Merged: 3/6/2026
Merged by: @fatedier
Base:
dev← Head:new📝 Commits (1)
2fc4ef5fix: close connections on error paths to prevent resource leaks📊 Changes
6 files changed (+13 additions, -0 deletions)
View changed files
📝
client/proxy/proxy.go(+1 -0)📝
client/visitor/sudp.go(+4 -0)📝
client/visitor/xtcp.go(+2 -0)📝
pkg/plugin/client/tls2raw.go(+2 -0)📝
pkg/plugin/client/unix_domain_socket.go(+3 -0)📝
server/proxy/http.go(+1 -0)📄 Description
Summary
Close()call before returning on error, preventing file descriptor and memory leaksFixed locations
server/proxy/http.gotmpConnWithEncryptionfailureclient/proxy/proxy.golocalConnWriteTofailureclient/visitor/sudp.govisitorConngetNewVisitorConnclient/visitor/xtcp.gotunnelConnWithEncryptionfailureclient/visitor/xtcp.golConn(UDP)NewKCPConnFromUDPfailurepkg/plugin/client/unix_domain_socket.golocalConnWriteTofailurepkg/plugin/client/tls2raw.gotlsConnTest plan
make buildpassesmake testpasses🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.