CURL: the cleanup has to be done before.