True however there are different ways to allocate memory (memScope, alloc, local function variables etc). Most likely getting caught out with the allocated items being freed before they are no longer used by something else (eg as a parameter in another function).