mirror of
https://github.com/apache/nuttx.git
synced 2026-05-27 19:36:35 +08:00
mempool:when deinit mempool,need mark dict NULL before free
Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
@@ -303,7 +303,7 @@ mempool_multiple_get_dict(FAR struct mempool_multiple_s *mpool,
|
|||||||
size_t row;
|
size_t row;
|
||||||
size_t col;
|
size_t col;
|
||||||
|
|
||||||
if (mpool == NULL || blk == NULL)
|
if (mpool == NULL || blk == NULL || mpool->dict == NULL)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@@ -888,6 +888,7 @@ void mempool_multiple_deinit(FAR struct mempool_multiple_s *mpool)
|
|||||||
}
|
}
|
||||||
|
|
||||||
mempool_multiple_free_chunk(mpool, mpool->dict);
|
mempool_multiple_free_chunk(mpool, mpool->dict);
|
||||||
|
mpool->dict = NULL;
|
||||||
nxrmutex_destroy(&mpool->lock);
|
nxrmutex_destroy(&mpool->lock);
|
||||||
mpool->free(mpool->arg, mpool);
|
mpool->free(mpool->arg, mpool);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user