Skip to content

Commit e12e9bf

Browse files
authored
Merge pull request #1167 from ldorau/Add_missing_unlock_in_an_error_handling_path_of_umf_ba_alloc
Add missing `unlock()` in an error handling path of `umf_ba_alloc()`
2 parents 3fac5f8 + cba0326 commit e12e9bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/base_alloc/base_alloc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2024 Intel Corporation
2+
* Copyright (C) 2024-2025 Intel Corporation
33
*
44
* Under the Apache License v2.0 with LLVM Exceptions. See LICENSE.TXT.
55
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
@@ -230,6 +230,7 @@ void *umf_ba_alloc(umf_ba_pool_t *pool) {
230230
// check if the free list is not empty
231231
if (pool->metadata.free_list == NULL) {
232232
LOG_ERR("base_alloc: Free list should not be empty before new alloc");
233+
utils_mutex_unlock(&pool->metadata.free_lock);
233234
return NULL;
234235
}
235236

0 commit comments

Comments
 (0)