Removed malloc/free for getting fsm results back to the user.