summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul Jain <rahul.jain@samsung.com>2020-07-21 11:18:45 (GMT)
committerRahul Jain <rahul.jain@samsung.com>2020-07-23 09:20:28 (GMT)
commit8f4dbb1aa7ce0b39a12b9cc908a8660c5d61f0cc (patch)
treee25f9acc773fef9e7838041984249361345fca1d
parentf8475e05aab8b64c6779fd4237dceb074b4208d6 (diff)
downloadconnman-tizen.zip
connman-tizen.tar.gz
connman-tizen.tar.bz2
Svace issues: Null check and memory leaksHEADsubmit/tizen/20200730.084504tizenrefs/changes/70/239070/2
Change-Id: I937af7e6dbe3a919c1d0b0d7dee4b481c2ef0982
-rwxr-xr-xplugins/wifi.c2
-rw-r--r--src/config.c4
-rwxr-xr-xsrc/dnsproxy.c7
-rwxr-xr-xsrc/network.c4
-rw-r--r--src/session.c8
5 files changed, 24 insertions, 1 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 7f26417..2f70ee7 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2986,7 +2986,7 @@ static int mesh_scan(struct connman_device *device)
wifi = connman_device_get_data(device);
- if (!wifi->mesh_interface)
+ if (!wifi || !wifi->mesh_interface)
return -ENOTSUP;
mesh_info = wifi->mesh_info;
diff --git a/src/config.c b/src/config.c
index 0e550e4..56ca2b8 100644
--- a/src/config.c
+++ b/src/config.c
@@ -647,7 +647,11 @@ static bool load_service(GKeyFile *keyfile, const char *group,
unsigned int ssid_len;
ssid_len = strlen(service->name);
+#if defined TIZEN_EXT
+ ssid = g_try_malloc0(ssid_len + 1);
+#else
ssid = g_try_malloc0(ssid_len);
+#endif
if (!ssid)
goto err;
diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index b244a02..178e98f 100755
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -2177,8 +2177,15 @@ static int forward_dns_reply(unsigned char *reply, int reply_len, int protocol,
req->resplen = 0;
req->resp = g_try_malloc(reply_len);
+#if defined TIZEN_EXT
+ if (!req->resp) {
+ g_free(new_reply);
+ return -ENOMEM;
+ }
+#else
if (!req->resp)
return -ENOMEM;
+#endif
memcpy(req->resp, reply, reply_len);
req->resplen = reply_len;
diff --git a/src/network.c b/src/network.c
index 243b502..636da18 100755
--- a/src/network.c
+++ b/src/network.c
@@ -735,6 +735,10 @@ static int dhcpv6_set_addresses(struct connman_network *network)
network->connecting = false;
ipconfig_ipv6 = __connman_service_get_ip6config(service);
+#if defined TIZEN_EXT
+ if (!ipconfig_ipv6)
+ goto err;
+#endif
err = __connman_ipconfig_address_add(ipconfig_ipv6);
if (err < 0)
goto err;
diff --git a/src/session.c b/src/session.c
index 808931a..6000b6d 100644
--- a/src/session.c
+++ b/src/session.c
@@ -1756,8 +1756,16 @@ static bool session_match_service(struct connman_session *session,
service_type = connman_service_get_type(service);
ifname = connman_service_get_interface(service);
+
+#if defined TIZEN_EXT
+ if (bearer_type == current_service_type) {
+ g_free(ifname);
+ return false;
+ }
+#else
if (bearer_type == current_service_type)
return false;
+#endif
if (bearer_type == service_type &&
(session->info->config.allowed_interface == NULL ||