From b6cc43272d721dc4a17eef366bc24b7eae76c304 Mon Sep 17 00:00:00 2001 From: Niklas Wenzel Date: Fri, 4 Sep 2026 18:33:10 +0200 Subject: [PATCH] metal : fix memory leak in early return --- ggml/src/ggml-metal/ggml-metal-context.m | 1 + 1 file changed, 1 insertion(+) diff --git a/ggml/src/ggml-metal/ggml-metal-context.m b/ggml/src/ggml-metal/ggml-metal-context.m index e1129db302..6cdc4006bc 100644 --- a/ggml/src/ggml-metal/ggml-metal-context.m +++ b/ggml/src/ggml-metal/ggml-metal-context.m @@ -111,6 +111,7 @@ ggml_metal_t ggml_metal_init(ggml_metal_device_t dev) { id queue = ggml_metal_device_get_queue(dev); if (queue == nil) { GGML_LOG_ERROR("%s: error: failed to create command queue\n", __func__); + free(res); return NULL; }