Skip to content

Commit 04f4a6d

Browse files
committed
Fix umf_ba_free() - do not assert on unknown pointer
Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 64456b7 commit 04f4a6d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/base_alloc/base_alloc.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,11 @@ void umf_ba_free(umf_ba_pool_t *pool, void *ptr) {
278278
umf_ba_chunk_t *chunk = (umf_ba_chunk_t *)ptr;
279279

280280
utils_mutex_lock(&pool->metadata.free_lock);
281-
assert(pool_contains_pointer(pool, ptr));
281+
if (!pool_contains_pointer(pool, ptr)) {
282+
utils_mutex_unlock(&pool->metadata.free_lock);
283+
return;
284+
}
285+
282286
chunk->next = pool->metadata.free_list;
283287
pool->metadata.free_list = chunk;
284288
pool->metadata.n_allocs--;

0 commit comments

Comments
 (0)