diff --git a/src/llama.cpp b/src/llama.cpp index 97dd1b3fea4b9..37d4aab2715f3 100644 --- a/src/llama.cpp +++ b/src/llama.cpp @@ -17656,6 +17656,7 @@ struct llama_data_read { read_to(&n_seq_id, sizeof(n_seq_id)); if (n_seq_id != 0) { + llama_batch_free(batch); LLAMA_LOG_ERROR("%s: invalid seq_id-agnostic kv cell\n", __func__); return false; }