From a4f25f879311f826264e9ff08061017c1c1ca771 Mon Sep 17 00:00:00 2001 From: ZXED Date: Sat, 9 Mar 2024 12:01:23 +0300 Subject: [PATCH] server: error handling: fix double free of ctx_sampling --- examples/server/server.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/server/server.cpp b/examples/server/server.cpp index 88661a944..420bc644d 100644 --- a/examples/server/server.cpp +++ b/examples/server/server.cpp @@ -958,6 +958,7 @@ struct server_context { { if (slot.ctx_sampling != nullptr) { llama_sampling_free(slot.ctx_sampling); + slot.ctx_sampling = nullptr; } slot.ctx_sampling = llama_sampling_init(slot.sparams); llama_set_rng_seed(ctx, slot.params.seed);