mempool:fix bug, use incorrect free in mempool init
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
parent
93a1adf83e
commit
df2925cf13
|
@ -174,7 +174,11 @@ int mempool_init(FAR struct mempool_s *pool, FAR const char *name)
|
|||
base = pool->alloc(pool, size);
|
||||
if (base == NULL)
|
||||
{
|
||||
mempool_free(pool, pool->ibase);
|
||||
if (pool->ibase)
|
||||
{
|
||||
pool->free(pool, pool->ibase);
|
||||
}
|
||||
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue