mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 12:33:27 +08:00
mempool:fix bug, use incorrect free in mempool init
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
@@ -174,7 +174,11 @@ int mempool_init(FAR struct mempool_s *pool, FAR const char *name)
|
|||||||
base = pool->alloc(pool, size);
|
base = pool->alloc(pool, size);
|
||||||
if (base == NULL)
|
if (base == NULL)
|
||||||
{
|
{
|
||||||
mempool_free(pool, pool->ibase);
|
if (pool->ibase)
|
||||||
|
{
|
||||||
|
pool->free(pool, pool->ibase);
|
||||||
|
}
|
||||||
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user