An incorrect variable was used to detect when the list of opened files became empty and needed to be deallocated. That resulted in a list of allocated pointers not freed.
==154211== still reachable: 8,168 bytes in 1 blocks
After the correct variable was used, valgrind showed the memory leak gone.
==163740== All heap blocks were freed -- no leaks are possible
An incorrect variable was used to detect when the list of opened files became empty and needed to be deallocated. That resulted in a list of allocated pointers not freed.
==154211== still reachable: 8,168 bytes in 1 blocks
After the correct variable was used, valgrind showed the memory leak gone.
==163740== All heap blocks were freed -- no leaks are possible