SSE: Fix goroutine leak in math operation expression parsing (#102380)

---------

Co-authored-by: Sam Jewell <sam.jewell@grafana.com>
This commit is contained in:
Kyle Brandt
2025-03-19 08:34:49 -04:00
committed by GitHub
co-authored by Sam Jewell
parent 216b6e96a9
commit 3f2ef07872
3 changed files with 109 additions and 11 deletions
+4 -1
View File
@@ -140,7 +140,10 @@ func (t *Tree) startParse(funcs []map[string]Func, lex *lexer) {
// stopParse terminates parsing.
func (t *Tree) stopParse() {
t.lex = nil
if t.lex != nil {
t.lex.Close()
t.lex = nil
}
}
// Parse parses the expression definition string to construct a representation