static int __set_i18n(const char *domain, const char *dir)
{
char *r;
+ char *lan;
if (domain == NULL) {
errno = EINVAL;
r = setlocale(LC_ALL, "");
/* if locale is not set properly, try again to set as language base */
if (r == NULL) {
- r = setlocale(LC_ALL, vconf_get_str(VCONFKEY_LANGSET));
- _DBG("*****appcore setlocale=%s\n", r);
+ lan = vconf_get_str(VCONFKEY_LANGSET);
+ if (lan != NULL) {
+ r = setlocale(LC_ALL, lan);
+ _DBG("*****appcore setlocale=%s\n", r);
+ free(lan);
+ }
}
if (r == NULL)
_ERR("appcore: setlocale() error");