GH614: Use memcpy()/strdup() when possible