Access strings via pointers, which reduces copying and the chances of leaks. Simplify cases where string arrays were modified - no need to replace the value as it's no longer allocated. Always complete the loop so references are freed.
This is a broken out version of the privacy panel dialog.