Hi Tomas,
> gsupplicant/supplicant.c | 2 ++
> plugins/wifi.c | 10 +++++++---
> 2 files changed, 9 insertions(+), 3 deletions(-)
patch in general looks fine to me.
> diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
> index 8452656..39302d7 100644
> --- a/gsupplicant/supplicant.c
> +++ b/gsupplicant/supplicant.c
> @@ -2115,6 +2115,7 @@ static void interface_select_network_result(const char
> *error,
>
> SUPPLICANT_DBG("");
>
> + g_free(data->ssid);
> dbus_free(data);
> }
>
> @@ -2157,6 +2158,7 @@ static void interface_add_network_result(const char
> *error,
> error:
> g_free(interface->network_path);
> interface->network_path = NULL;
> + g_free(data->ssid);
> g_free(data);
> }
>
> diff --git a/plugins/wifi.c b/plugins/wifi.c
> index 62d9216..98f2225 100644
> --- a/plugins/wifi.c
> +++ b/plugins/wifi.c
> @@ -645,27 +645,31 @@ static int network_connect(struct connman_network
> *network)
> struct connman_device *device = connman_network_get_device(network);
> struct wifi_data *wifi;
> GSupplicantInterface *interface;
> - GSupplicantSSID ssid;
> + GSupplicantSSID *ssid;
>
> DBG("network %p", network);
>
> if (device == NULL)
> return -ENODEV;
>
> + ssid = g_malloc0(sizeof(GSupplicantSSID));
> + if (ssid == NULL)
> + return -ENOMEM;
> +
however this needs to be a g_try_malloc0.
> wifi = connman_device_get_data(device);
> if (wifi == NULL)
> return -ENODEV;
And here you are leaking ssid.
> interface = wifi->interface;
>
> - ssid_init(&ssid, network);
> + ssid_init(ssid, network);
>
> if (wifi->disconnecting == TRUE)
> wifi->pending_network = connman_network_ref(network);
> else {
> wifi->network = connman_network_ref(network);
>
> - return g_supplicant_interface_connect(interface, &ssid,
> + return g_supplicant_interface_connect(interface, ssid,
> connect_callback, NULL);
> }
>
Regards
Marcel
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman