Fixed memory leak for vconf_get_str 00/72400/2 accepted/tizen/ivi/20160602.230623 accepted/tizen/mobile/20160602.230556 accepted/tizen/tv/20160602.230613 accepted/tizen/wearable/20160602.230539 submit/tizen/20160602.021703
authorhyunuktak <hyunuk.tak@samsung.com>
Tue, 31 May 2016 23:51:11 +0000 (08:51 +0900)
committerhyunuktak <hyunuk.tak@samsung.com>
Wed, 1 Jun 2016 00:10:42 +0000 (09:10 +0900)
Change-Id: I3c99e343d738816dd08a84e49dc19ad0bddce155
Signed-off-by: hyunuktak <hyunuk.tak@samsung.com>
packaging/capi-network-connection.spec
src/connection.c

index e7fee35..c5672ee 100755 (executable)
@@ -1,6 +1,6 @@
 Name:          capi-network-connection
 Summary:       Network Connection library in TIZEN C API
-Version:       1.0.87
+Version:       1.0.88
 Release:       1
 Group:         System/Network
 License:       Apache-2.0
index 8c2b5b1..3901e2e 100755 (executable)
@@ -210,6 +210,9 @@ static gboolean __connection_cb_ip_changed_cb_idle(gpointer user_data)
                return FALSE;
 
        ip_addr = vconf_get_str(VCONFKEY_NETWORK_IP);
+       if (ip_addr == NULL)
+               CONNECTION_LOG(CONNECTION_ERROR, //LCOV_EXCL_LINE
+                       "vconf_get_str(VCONFKEY_NETWORK_IP) is Failed");
 
        callback = __connection_get_ip_changed_callback(local_handle);
        data = __connection_get_ip_changed_userdata(local_handle);
@@ -217,6 +220,8 @@ static gboolean __connection_cb_ip_changed_cb_idle(gpointer user_data)
        if (callback)
                callback(ip_addr, NULL, data);
 
+       g_free(ip_addr);
+
        return FALSE;
 }
 
@@ -297,6 +302,9 @@ static gboolean __connection_cb_proxy_changed_cb_idle(gpointer user_data)
                return FALSE;
 
        proxy = vconf_get_str(VCONFKEY_NETWORK_PROXY);
+       if (proxy == NULL)
+               CONNECTION_LOG(CONNECTION_ERROR, //LCOV_EXCL_LINE
+                       "vconf_get_str(VCONFKEY_NETWORK_PROXY) is Failed");
 
        callback = __connection_get_proxy_changed_callback(local_handle);
        data = __connection_get_proxy_changed_userdata(local_handle);
@@ -304,6 +312,8 @@ static gboolean __connection_cb_proxy_changed_cb_idle(gpointer user_data)
        if (callback)
                callback(proxy, NULL, data);
 
+       g_free(proxy);
+
        return FALSE;
 }