server: free sampling contexts on exit

This cleans up last leak found by the address sanitizer.
This commit is contained in:
Steve Grubb 2024-05-13 15:07:47 -04:00
parent ee52225067
commit 8e04c3ce97

View file

@ -671,6 +671,12 @@ struct server_context {
model = nullptr;
}
// Clear any sampling context
for (server_slot & slot : slots) {
if (slot.ctx_sampling != nullptr)
llama_sampling_free(slot.ctx_sampling);
}
llama_batch_free(batch);
}