[PR #1465] [MERGED] dev:udp: Add an Unlock before a continue, to fix a double lock bug #4396

Closed
opened 2026-05-05 14:41:17 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/1465
Author: @lzhfromustc
Created: 10/15/2019
Status: Merged
Merged: 10/15/2019
Merged by: @fatedier

Base: devHead: dev_dup_mis_unlock


📝 Commits (1)

  • 8eb945e dev:udp: Add an Unlock before a continue, to fix a double lock bug

📊 Changes

1 file changed (+1 additions, -0 deletions)

View changed files

📝 models/proto/udp/udp.go (+1 -0)

📄 Description

Description
A mutex mu is locked at line 115 of udp.go, and unlocked at line 124. However, there is a continue at line 120 if err != nil, and there is no unlock before this continue. So if the continue is executed, there will be a double lock bug.

How it is fixed
Add an mu.Unlock() before the continue.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fatedier/frp/pull/1465 **Author:** [@lzhfromustc](https://github.com/lzhfromustc) **Created:** 10/15/2019 **Status:** ✅ Merged **Merged:** 10/15/2019 **Merged by:** [@fatedier](https://github.com/fatedier) **Base:** `dev` ← **Head:** `dev_dup_mis_unlock` --- ### 📝 Commits (1) - [`8eb945e`](https://github.com/fatedier/frp/commit/8eb945ee9b14c1e4b513d401ddf21a8ce922651e) dev:udp: Add an Unlock before a continue, to fix a double lock bug ### 📊 Changes **1 file changed** (+1 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `models/proto/udp/udp.go` (+1 -0) </details> ### 📄 Description ***Description*** A mutex `mu` is locked at line 115 of [udp.go](https://github.com/fatedier/frp/blob/master/models/proto/udp/udp.go#L115), and unlocked at line 124. However, there is a `continue` at line 120 if `err != nil`, and there is no unlock before this `continue`. So if the `continue` is executed, there will be a double lock bug. ***How it is fixed*** Add an `mu.Unlock()` before the continue. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:41:17 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#4396
No description provided.