Commit 3628b1e8 authored by wujing's avatar wujing

fix double free in free_mem_block

parent fa45a7d5
......@@ -45,8 +45,14 @@ extern "C" {
}
void free_mem_block (mem_block_t *leP, const char *caller) {
AssertFatal(leP!=NULL,"");
// AssertFatal(leP!=NULL,"");
if (leP != NULL) {
free(leP);
LOG_I(TMR, "intertask_interface free_mem_block is called, after free leP is %d(NULL:0, notNULL:1)\n", leP==NULL?0:1);
leP = NULL; //prevent double free
} else {
LOG_I(TMR, "intertask_interface free_mem_block is called, but before free leP is NULL\n");
}
}
mem_block_t *get_free_mem_block (uint32_t sizeP, const char *caller) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment