summaryrefslogtreecommitdiff
path: root/typeparser.cpp
diff options
context:
space:
mode:
authorMark Rowe <mark@vector35.com>2026-05-11 18:49:26 -0700
committerMark Rowe <mark@vector35.com>2026-05-19 10:36:46 -0700
commitfd40266f767e51e649fb48376e25f47a60d79765 (patch)
treedb351a36617200d4ad659bb3c1aa921b8d08f204 /typeparser.cpp
parent297a98bff289ecde90d808f6538c2c5edf804af6 (diff)
Fix incorrect reference counting in C++ API
Diffstat (limited to 'typeparser.cpp')
-rw-r--r--typeparser.cpp4
1 files changed, 3 insertions, 1 deletions
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<TypeParserError>& er
BNFreeString(apiError.fileName);
}
- return string;
+ std::string result = string ? string : "";
+ BNFreeString(string);
+ return result;
}