fixed leak serializing rules' operator

mainly when connecting by the first time to the GUI, and at the same
time asking to allow/deny a connection.
This commit is contained in:
Gustavo Iñiguez Goia 2023-12-09 19:06:40 +01:00
parent 250dcb1f6d
commit 9efaa37098

View file

@ -127,6 +127,9 @@ func (r *Rule) Serialize() *protocol.Rule {
if r == nil { if r == nil {
return nil return nil
} }
r.Operator.Lock()
defer r.Operator.Unlock()
protoRule := &protocol.Rule{ protoRule := &protocol.Rule{
Created: r.Created.Unix(), Created: r.Created.Unix(),
Name: string(r.Name), Name: string(r.Name),