Module: kamailio Branch: master Commit: d0a353342b559191aafc732174773e132554694a URL: https://github.com/kamailio/kamailio/commit/d0a353342b559191aafc732174773e13...
Author: Daniel-Constantin Mierla miconda@gmail.com Committer: Daniel-Constantin Mierla miconda@gmail.com Date: 2023-11-21T13:57:52+01:00
core/mem: tlsf - cast to char* for pointer operations
---
Modified: src/core/mem/tlsf_malloc.c
---
Diff: https://github.com/kamailio/kamailio/commit/d0a353342b559191aafc732174773e13... Patch: https://github.com/kamailio/kamailio/commit/d0a353342b559191aafc732174773e13...
---
diff --git a/src/core/mem/tlsf_malloc.c b/src/core/mem/tlsf_malloc.c index f7cdeab5eec..e599f84aff9 100644 --- a/src/core/mem/tlsf_malloc.c +++ b/src/core/mem/tlsf_malloc.c @@ -1058,9 +1058,10 @@ void tlsf_free(tlsf_t tlsf, void *ptr) control->allocated -= block_size(block); control->real_used -= (block_size(block) - + (ptr - - (void *)block - /* prev_phys_block is melted in the previous block when the current block is used */ + + ((char *)ptr + - (char *)block + /* prev_phys_block is melted in the previous + * block when the current block is used */ + sizeof(block->prev_phys_block))); #ifdef DBG_TLSF_MALLOC block->alloc_info.file = file;