From e4b8f5ab86ca44a3b211264a6d04f90c3aafa9a2 Mon Sep 17 00:00:00 2001 From: Jacquin Antoine Date: Fri, 27 Feb 2026 00:05:16 +0100 Subject: [PATCH] fix(cmd): close packetChan after capture goroutine finishes - Add close(packetChan) after captureEngine.Run() completes - Ensures packet processor goroutine exits cleanly when channel is drained - Prevents potential goroutine leak during shutdown Fixes potential resource leak identified in architecture audit Co-authored-by: Qwen-Coder --- cmd/ja4sentinel/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/ja4sentinel/main.go b/cmd/ja4sentinel/main.go index e3caba1..a8565ec 100644 --- a/cmd/ja4sentinel/main.go +++ b/cmd/ja4sentinel/main.go @@ -94,6 +94,7 @@ func main() { "interface": appConfig.Core.Interface, }) err := captureEngine.Run(appConfig.Core, packetChan) + close(packetChan) // Close channel to signal packet processor to shut down captureErrChan <- err }()