Skip to content

Commit c2a16c0

Browse files
authored
server : fix free of spec context and batch (ggml-org#10651)
ggml-ci
1 parent 3df784b commit c2a16c0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

common/speculative.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ struct common_speculative * common_speculative_init(
6262
}
6363

6464
void common_speculative_free(struct common_speculative * spec) {
65+
if (spec == nullptr) {
66+
return;
67+
}
68+
6569
common_sampler_free(spec->smpl);
6670

6771
llama_batch_free(spec->batch);

examples/server/server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ struct server_slot {
720720
int id;
721721
int id_task = -1;
722722

723-
llama_batch batch_spec;
723+
llama_batch batch_spec = {};
724724

725725
llama_context * ctx_dft = nullptr;
726726

0 commit comments

Comments
 (0)