Fixed memory leak issue 45/76145/1 accepted/tizen/common/20160623.154547 accepted/tizen/ivi/20160623.125258 accepted/tizen/mobile/20160623.125209 accepted/tizen/tv/20160623.125222 accepted/tizen/wearable/20160623.125242 submit/tizen/20160623.100245
authorchleun.moon <chleun.moon@samsung.com>
Thu, 23 Jun 2016 02:46:12 +0000 (11:46 +0900)
committerchleun.moon <chleun.moon@samsung.com>
Thu, 23 Jun 2016 02:47:28 +0000 (11:47 +0900)
Change-Id: I072d338ba7e421ae1404fa406171dc56b9bdf8fd
Signed-off-by: cheoleun <chleun.moon@samsung.com>
src/wifi-direct-util.c

index 665782c..7b5f7cd 100755 (executable)
@@ -363,15 +363,18 @@ void _wfd_util_check_country_cb(keynode_t *key, void *data)
        ccode = g_key_file_get_string(keyfile, "ccode_map", mcc, &err);
        if (!ccode) {
                WDS_LOGE("Failed to get country code string(%s)", err->message);
+               g_key_file_free(keyfile);
                return;
        }
 
        res = wfd_oem_set_country(manager->oem_ops, ccode);
-       if (res < 0) {
+       if (res < 0)
                WDS_LOGE("Failed to set contry code");
-               return;
-       }
-       WDS_LOGD("Succeeded to set country code(%s)", ccode);
+       else
+               WDS_LOGD("Succeeded to set country code(%s)", ccode);
+
+       g_key_file_free(keyfile);
+       g_free(ccode);
 
        __WDS_LOG_FUNC_EXIT__;
        return;