From fd40266f767e51e649fb48376e25f47a60d79765 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Mon, 11 May 2026 18:49:26 -0700 Subject: Fix incorrect reference counting in C++ API --- typeparser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'typeparser.cpp') diff --git a/typeparser.cpp b/typeparser.cpp index 8fe20a1f..18ecac08 100644 --- a/typeparser.cpp +++ b/typeparser.cpp @@ -97,7 +97,9 @@ std::string TypeParser::FormatParseErrors(const std::vector& er BNFreeString(apiError.fileName); } - return string; + std::string result = string ? string : ""; + BNFreeString(string); + return result; } -- cgit v1.3.1