Remplace use of strdup with std::string.