diff options
author | Hongyu Ouyang <96765450+casavaca@users.noreply.github.com> | 2023-12-07 02:25:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-07 12:25:22 +0200 |
commit | 81bc9214a389362010f7a57f4cbc30e5f83a2d28 (patch) | |
tree | 31bce230b0591eca9bd8efe8c49233727119ed6c /examples/quantize-stats/quantize-stats.cpp | |
parent | 05cd6e5036d72d0930de4d8f6be7bce09e8dda24 (diff) |
train : fix #4227 (double free in examples/train-text-from-scratch/train-text-from-scratch.cpp) (#4351)
On commit b1108 (44c117f4) xaedes added
ggml_allocr * alloc = NULL;
... (many lines in between)
if (alloc) {
ggml_allocr_free(alloc);
}
Which is correct, but it's easy to lose context after many lines in between.
On commit b1287 (0e76a899) xaedes made a big change. From here on, alloc is freed eagerly.
alloc = ggml_allocr_new(...)
... (short lines of code)
ggml_allocr_free(alloc)
This happens a few times, but alloc is never set to NULL, and many lines below,
we still have
if (alloc) {
ggml_allocr_free(alloc);
}
which causes a double-free.
Diffstat (limited to 'examples/quantize-stats/quantize-stats.cpp')
0 files changed, 0 insertions, 0 deletions