Free vconf_get_str using free() instead of g_free() 56/124056/2 accepted/tizen/unified/20170412.152330 submit/tizen/20170411.091632 submit/tizen/20170412.005740
authorAbhishek Sansanwal <abhishek.s94@samsung.com>
Mon, 10 Apr 2017 05:16:00 +0000 (10:46 +0530)
committerAbhishek Sansanwal <abhishek.s94@samsung.com>
Mon, 10 Apr 2017 05:49:54 +0000 (11:19 +0530)
Signed-off-by: Abhishek Sansanwal <abhishek.s94@samsung.com>
Change-Id: I1ab58242e0e0b5201a9246279986cbc700dc4a1e

src/connection_profile.c

index 4b4dfbf..236e9af 100755 (executable)
@@ -106,7 +106,7 @@ static void __profile_init_wifi_profile(net_profile_info_t *profile_info)
 }
 
 //LCOV_EXCL_START
-static const char* __profile_get_ethernet_proxy(void)
+static char* __profile_get_ethernet_proxy(void)
 {
        char *proxy;
 
@@ -697,7 +697,6 @@ EXPORT_API int connection_profile_get_proxy_type(connection_profile_h profile, c
                return CONNECTION_ERROR_INVALID_PARAMETER;
        }
 
-       const char *proxy;
        net_profile_info_t *profile_info = profile;
        net_dev_info_t *net_info = __profile_get_net_info(profile_info);
        if (net_info == NULL)
@@ -705,11 +704,13 @@ EXPORT_API int connection_profile_get_proxy_type(connection_profile_h profile, c
 
        //LCOV_EXCL_START
        if (profile_info->profile_type == NET_DEVICE_ETHERNET) {
-               proxy = __profile_get_ethernet_proxy();
-               if (proxy == NULL)
+               char *proxy = __profile_get_ethernet_proxy();
+               if (proxy == NULL) {
                        *type = CONNECTION_PROXY_TYPE_DIRECT;
-               else
+               } else {
                        *type = CONNECTION_PROXY_TYPE_MANUAL;
+                       free(proxy);
+               }
 
                return CONNECTION_ERROR_NONE;
        }