From: hyunuktak Date: Tue, 31 May 2016 23:51:11 +0000 (+0900) Subject: Fixed memory leak for vconf_get_str X-Git-Tag: accepted/tizen/ivi/20160602.230623^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fapi%2Fconnection.git;a=commitdiff_plain;h=2ee2ccf0b84fdcce145d1a4e5004e3be4caef254;ds=sidebyside Fixed memory leak for vconf_get_str Change-Id: I3c99e343d738816dd08a84e49dc19ad0bddce155 Signed-off-by: hyunuktak --- diff --git a/packaging/capi-network-connection.spec b/packaging/capi-network-connection.spec index e7fee35..c5672ee 100755 --- a/packaging/capi-network-connection.spec +++ b/packaging/capi-network-connection.spec @@ -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 diff --git a/src/connection.c b/src/connection.c index 8c2b5b1..3901e2e 100755 --- a/src/connection.c +++ b/src/connection.c @@ -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; }