Problems with freeing allocated memory (freeRTOS v.8.0)

My code looks like ~~~~~~ /—— VARIABLES ——/ uint8t how; typedef struct { uint8t *nfcid; } Test; typedef union { Test here; } Haha; Haha *haha; /—— FUNCTIONS ——/ void memoryAlloc( Haha **haha ) { Haha *h =(Haha *)pvPortMalloc( (1) * sizeof(Haha) ); *haha = h; uint8t *r =(uint8t )pvPortMalloc( (1) * sizeof(uint8_t) ); *r = 0x0F+how; (haha)->here.nfcid = r; } void freeAlloc( Haha *haha ) { vPortFree(haha->tutaj.nfcid); vPortFree(haha); } /—— MAIN ——/ void main() { how++; memoryAlloc(&haha); freeAlloc(haha); } ~~~~~~ and it seems like vPortFree doesn’t free memory. What may be the problem?

Problems with freeing allocated memory (freeRTOS v.8.0)

Your use of pointers to pointers is too mind bending for me to be able to work it out, and I don’t know where tutaj came from at all. Try creating a dummy application is something like MingW that runs the code with normal C lib mallocs and frees then step the code to see what it’s doing.