Parcourir la source

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
Paul Tsochantaris il y a 1 an
Parent
commit
ceebbb5b21
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      ggml-alloc.c

+ 1 - 1
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;
     }