}
while (config_ids) {
- bool rv = 0;
+ bool rv = 1;
struct _wifi_config *h;
gchar *id = config_ids->data;
h->eap_config = g_new0(struct _wifi_eap_config, 1);
if (h->eap_config == NULL) {
ret = WIFI_ERROR_OUT_OF_MEMORY;
+ g_free(h);
break;
}
ret = wifi_load_eap_configurations(dbus_h, id, &h->name,
h->address_family = WIFI_ADDRESS_FAMILY_IPV4;
h->is_saved = TRUE;
rv = callback((wifi_config_h)h, user_data);
- g_free(h->name);
- g_free(h->proxy_address);
- if (h->eap_config) {
- g_free(h->eap_config->ca_cert);
- g_free(h->eap_config->client_cert);
- g_free(h->eap_config->private_key);
- g_free(h->eap_config->anonymous_identity);
- g_free(h->eap_config->identity);
- g_free(h->eap_config->subject_match);
- g_free(h->eap_config);
- }
- g_free(h);
- h = NULL;
+ }
- if (rv == false)
- break;
+ g_free(h->name);
+ g_free(h->proxy_address);
+ if (h->eap_config) {
+ g_free(h->eap_config->ca_cert);
+ g_free(h->eap_config->client_cert);
+ g_free(h->eap_config->private_key);
+ g_free(h->eap_config->anonymous_identity);
+ g_free(h->eap_config->identity);
+ g_free(h->eap_config->subject_match);
+ g_free(h->eap_config);
}
+ g_free(h);
+ h = NULL;
+
+ if (rv == false)
+ break;
config_ids = config_ids->next;
}