Open kamar535 opened 1 year ago
I wrongly (stupidly) assumed that sem_destroy would do free on the memory to which a pointer was passed to sem_init. Calling sem_destroy only "destroys" the internals of the semaphore but since I used malloc to allocate that memory I must use free to de-allocate.
Should there be a free(sem) in https://github.com/os-ospp-dsp/threads-synchronization-deadlock/blob/main/mandatory/psem/linux_semaphores.c or does sem_destroy take care of this?