Skip to content

Commit

Permalink
contrib/valyala/fasthttp.v1: fix memory leak of spanOpts (#2962)
Browse files Browse the repository at this point in the history
Co-authored-by: Pisit (King) Tangkoblarp <[email protected]>
  • Loading branch information
0angelic0 and king-t2p authored Nov 4, 2024
1 parent 2d679b9 commit 4d79271
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions contrib/valyala/fasthttp.v1/fasthttp.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ func WrapHandler(h fasthttp.RequestHandler, opts ...Option) fasthttp.RequestHand
fn(cfg)
}
log.Debug("contrib/valyala/fasthttp.v1: Configuring Middleware: cfg: %#v", cfg)
spanOpts := []tracer.StartSpanOption{
tracer.ServiceName(cfg.serviceName),
}
return func(fctx *fasthttp.RequestCtx) {
if cfg.ignoreRequest(fctx) {
h(fctx)
return
}
spanOpts := []tracer.StartSpanOption{
tracer.ServiceName(cfg.serviceName),
}
spanOpts = append(spanOpts, defaultSpanOptions(fctx)...)
fcc := &fasthttptrace.HTTPHeadersCarrier{
ReqHeader: &fctx.Request.Header,
Expand Down

0 comments on commit 4d79271

Please sign in to comment.