diff options
author | Paul Tsochantaris <ptsochantaris@icloud.com> | 2024-01-29 22:19:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-29 23:19:29 +0100 |
commit | ceebbb5b21b971941b2533210b74bf359981006c (patch) | |
tree | 14e5eadf42ce837781804bf96943e8711141dc4a | |
parent | 6daa69ee81851ab26ca8aefca1a4202941fc0262 (diff) |
ggml alloc: Fix for null dereference on alloc failure (#5200)
* Fix for a null pointer dereference if a metal GGML buffer fails to be allocated
* Freeing the allocated buffers rather than the pointer in ggml-alloc.c
* Fixed the fix of the fix
-rw-r--r-- | ggml-alloc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ggml-alloc.c b/ggml-alloc.c index dfe5ba2e..f9be6e1c 100644 --- a/ggml-alloc.c +++ b/ggml-alloc.c @@ -791,7 +791,7 @@ static bool alloc_tensor_range(struct ggml_context * ctx, for (size_t i = 0; i < *n_buffers; i++) { ggml_backend_buffer_free(*buffers[i]); } - free(buffers); + free(*buffers); return false; } |