From 9e05cc1d6916214120189ed7fee83296bdabe574 Mon Sep 17 00:00:00 2001 From: drbh Date: Wed, 16 Aug 2023 20:58:37 -0400 Subject: [PATCH] avoid dangling pointers in candidate cleanup --- tests/test-llama-grammar.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test-llama-grammar.cpp b/tests/test-llama-grammar.cpp index d0b7c4897..2fa4f99a9 100644 --- a/tests/test-llama-grammar.cpp +++ b/tests/test-llama-grammar.cpp @@ -396,6 +396,7 @@ int main() for (auto &candidate : next_candidates) { delete[] candidate.code_points; + candidate.code_points = nullptr; } return 0; }