New380 / cubesat-space-protocol

Automatically exported from code.google.com/p/cubesat-space-protocol
0 stars 0 forks source link

Memory Leak in Binary Semaphores #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The semaphore system on POSIX and FreeRTOS handles buffers differently.

A call to csp_bin_sem_create on FreeRTOS calls pvPortMalloc (through a 
QueueCreate call). The resulting handle is therefore a direct link to the 
malloc'ed area and this MUST be free'd again.

A call to csp_bin_sem_create on POSIX calls sem_init which works directly on 
the type given as argument, so in this case the semaphore variable is stored in 
the user storage and not allocated on the HEAP. Therefore this semaphore MUST 
NOT be free'd!

This is inconsistent and results in a memory leak if binary semaphores are used 
on FreeRTOS!

Original issue reported on code.google.com by johan.de...@gmail.com on 25 Jun 2010 at 7:25

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r83.

Original comment by johan.de...@gmail.com on 28 Jun 2010 at 1:03