Skip to content

Commit

Permalink
internal/appsec: defer wafCtx.Close()
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellzy committed Dec 6, 2022
1 parent 6c03b89 commit 11a4cfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/appsec/waf.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ func newGRPCWAFEventListener(handle *waf.Handle, addresses []string, timeout tim
// The WAF event listener got concurrently released
return
}
defer wafCtx.Close()

// The same address is used for gRPC and http when it comes to client ip
values := map[string]interface{}{}
Expand All @@ -231,7 +232,6 @@ func newGRPCWAFEventListener(handle *waf.Handle, addresses []string, timeout tim
}

matches, actionIds := runWAF(wafCtx, values, timeout)
wafCtx.Close()
if len(matches) > 0 {
interrupt := false
for _, id := range actionIds {
Expand Down

0 comments on commit 11a4cfb

Please sign in to comment.