Fix memory leaks and dereference without null check
[platform/upstream/connman.git] / plugins / wifi.c
index 6a886d5..4257a5d 100755 (executable)
@@ -2643,6 +2643,9 @@ static int get_latest_connections(int max_ssids,
                                g_sequence_free(latest_list);
                                g_key_file_free(keyfile);
                                g_free(ssid);
+#if defined TIZEN_EXT
+                               g_strfreev(services);
+#endif
                                return -ENOMEM;
                        }
 
@@ -5244,6 +5247,8 @@ static void network_changed(GSupplicantNetwork *network, const char *property)
                        need_save = connman_device_set_last_connected_ident(wifi->device, service_ident);
                        if (need_save)
                                connman_device_save_last_connected(wifi->device);
+
+                       g_free(service_ident);
                }
 
                connman_network_set_last_connected_bssid(connman_network,