metal : fix memory leak in early return (#28399)
This commit is contained in:
@@ -111,6 +111,7 @@ ggml_metal_t ggml_metal_init(ggml_metal_device_t dev) {
|
|||||||
id<MTLCommandQueue> queue = ggml_metal_device_get_queue(dev);
|
id<MTLCommandQueue> queue = ggml_metal_device_get_queue(dev);
|
||||||
if (queue == nil) {
|
if (queue == nil) {
|
||||||
GGML_LOG_ERROR("%s: error: failed to create command queue\n", __func__);
|
GGML_LOG_ERROR("%s: error: failed to create command queue\n", __func__);
|
||||||
|
free(res);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user