Trying to fix unfreed memory blocks