Commit 3f1deb1
fix(imatrix): null mtp_batch.token after free to prevent double-free
llama_batch_free() checks and frees batch.token if non-null. Since we
manually allocate mtp_batch.token (llama_batch_init with n_embd>0 only
allocates embd, not token), we must null the pointer after our explicit
free() in all three cleanup paths before calling llama_batch_free().
Bug present in upstream ggml-org#23476 as well; added here as fork-specific fix.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent b82080b commit 3f1deb1
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1101 | 1101 | | |
1102 | 1102 | | |
1103 | 1103 | | |
| 1104 | + | |
1104 | 1105 | | |
1105 | 1106 | | |
1106 | 1107 | | |
| |||
1115 | 1116 | | |
1116 | 1117 | | |
1117 | 1118 | | |
| 1119 | + | |
1118 | 1120 | | |
1119 | 1121 | | |
1120 | 1122 | | |
| |||
1181 | 1183 | | |
1182 | 1184 | | |
1183 | 1185 | | |
| 1186 | + | |
1184 | 1187 | | |
1185 | 1188 | | |
1186 | 1189 | | |
| |||
0 commit comments