* We need to save the old locale and switch to "C" because the locale
* influences the formatting of %f and we want it a certain way.
*/
- saved_locale = setlocale(LC_ALL, 0);
+ saved_locale = strdup(setlocale(LC_ALL, 0));
+ if (0 == saved_locale)
+ return false;
setlocale(LC_ALL, "C");
#if defined _MSC_VER || defined __MINGW32__
_snprintf(buffer, sizeof(buffer)-1, format, name, value);
snprintf(buffer, sizeof(buffer)-1, format, name, value);
#endif
setlocale(LC_ALL, saved_locale);
+ free(saved_locale);
entry.entry = (FLAC__byte *)buffer;
entry.length = strlen(buffer);