Forgot to allocate c. Also was accidentally freeing cache blocks