Set session->filter to NULL after freeing