Skip to content

Commit a4638e3

Browse files
authoredSep 27, 2024··
fix: parser: fix memory leak in goexpression.Func (fixes #916) (#935)
1 parent f5e2469 commit a4638e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎parser/v2/goexpression/parse.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ func Func(content string) (name, expr string, err error) {
256256
err = errors.New("parser error: function identifier")
257257
return false
258258
}
259-
expr = src[start:end]
259+
expr = strings.Clone(src[start:end])
260260
name = fn.Name.Name
261261
return false
262262
})

0 commit comments

Comments
 (0)
Please sign in to comment.