Fix memory leak 22/104022/2 accepted/tizen/3.0/common/20161213.163932 accepted/tizen/3.0/ivi/20161213.025710 accepted/tizen/3.0/mobile/20161213.025345 accepted/tizen/3.0/tv/20161213.025429 accepted/tizen/3.0/wearable/20161213.025605 submit/tizen_3.0/20161212.043612 submit/tizen_3.0/20161212.123626
authorJunghoon Park <jh9216.park@samsung.com>
Mon, 12 Dec 2016 06:15:18 +0000 (15:15 +0900)
committerJunghoon Park <jh9216.park@samsung.com>
Mon, 12 Dec 2016 06:21:15 +0000 (15:21 +0900)
Change-Id: Id5fccf4cb4bd0cb2ee11d2cebf20b45fd0a1546a
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
src/appcore-efl.c
src/appcore-i18n.c

index 1378463..323242c 100644 (file)
@@ -422,6 +422,8 @@ static void __do_app(enum app_event event, void *data, bundle * b)
        switch (event) {
        case AE_RESET:
                _DBG("[APP %d] RESET", _pid);
+               if (ui->pending_data)
+                       bundle_free(ui->pending_data);
                ui->pending_data = bundle_dup(b);
                LOG(LOG_DEBUG, "LAUNCH", "[%s:Application:reset:start]", ui->name);
 
index 5cae8d7..3cbefcc 100644 (file)
@@ -82,6 +82,7 @@ void update_region(void)
 static int __set_i18n(const char *domain, const char *dir)
 {
        char *r;
+       char *lan;
 
        if (domain == NULL) {
                errno = EINVAL;
@@ -91,8 +92,12 @@ static int __set_i18n(const char *domain, const char *dir)
        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");