Revert "use of copy(…) can cause memory segfault"

This reverts commit 365a76f93f32fd952b2b8aec663e2e43e10e5da9.