From 03bf3750fc79fcf0848761aa4ab0e06c06581a67 Mon Sep 17 00:00:00 2001 From: Michael Matloka Date: Tue, 17 Oct 2023 00:16:42 +0200 Subject: [PATCH] Fix one more leak --- hogql_parser/parser.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hogql_parser/parser.cpp b/hogql_parser/parser.cpp index 3882a77fbd73e8..4fae49ad24a365 100644 --- a/hogql_parser/parser.cpp +++ b/hogql_parser/parser.cpp @@ -431,8 +431,10 @@ class HogQLParseTreeConverter : public HogQLParserBaseVisitor { PyObject* next_join = PyObject_GetAttrString(last_join, "next_join"); while (!Py_IsNone(next_join)) { last_join = next_join; + Py_DECREF(next_join); next_join = PyObject_GetAttrString(last_join, "next_join"); } + Py_DECREF(next_join); PyObject_SetAttrString(last_join, "next_join", join2); Py_DECREF(join2); @@ -465,8 +467,10 @@ class HogQLParseTreeConverter : public HogQLParserBaseVisitor { PyObject* next_join = PyObject_GetAttrString(last_join, "next_join"); while (!Py_IsNone(next_join)) { last_join = next_join; + Py_DECREF(next_join); next_join = PyObject_GetAttrString(last_join, "next_join"); } + Py_DECREF(next_join); PyObject_SetAttrString(last_join, "next_join", join2); Py_DECREF(join2);