darktable-org/darktable — pull request #321 by LebedevRI (2013-10-12 14:50:05+00:00)
Title: strdup locale to avoid use-after-free

Found by clang AddressSanitizer

To be sure you can use the returned string encoding the currently selected locale at a later time, you must make a copy of the string. It is not guaranteed that the returned pointer remains valid over time.
From https://www.gnu.org/software/libc/manual/html_node/Setting-the-Locale.html