result = g_file_get_contents(src, &buf, &length, &error);
if (result != TRUE) {
- ERR("Failed to read %s[%s]", error->message);
+ ERR("Failed to read [%s]", error->message);
g_error_free(error);
return result;
result = g_file_set_contents(dst, buf, length, &error);
if (result != TRUE) {
- ERR("Failed to write %s[%s]", error->message);
+ ERR("Failed to write [%s]", error->message);
g_error_free(error);
}
cert_file = strrchr(value, '/');
if (cert_file == NULL) {
ERR("Failed to get cert file: %s", value);
+ g_free(field);
+ g_free(value);
goto out;
}
WIFI_CERT_STORAGEDIR, encoded_ssid);
if (dirname == NULL) {
ERR("Failed to create dirname");
+ g_free(field);
+ g_free(value);
goto out;
}
if (g_file_test(dirname, G_FILE_TEST_IS_DIR) != TRUE) {
S_IXGRP | S_IROTH | S_IXOTH) < 0) {
if (errno != EEXIST) {
g_free(dirname);
+ g_free(field);
+ g_free(value);
goto out;
}
}
WIFI_CERT_STORAGEDIR, encoded_ssid, cert_file);
if (cert_path == NULL) {
ERR("Failed to create cert path");
+ g_free(field);
+ g_free(value);
goto out;
}
if (__netconfig_copy_config(value, cert_path) != TRUE) {
ERR("Failed to read cert file %s", value);
g_free(cert_path);
+ g_free(field);
+ g_free(value);
goto out;
}
const gchar *service, GVariant *fields)
{
gboolean updated = FALSE;
- gboolean reply = FALSE;
gboolean result = FALSE;
- g_return_val_if_fail(wifi != NULL, FALSE);
+ g_return_val_if_fail(wifi != NULL, TRUE);
DBG("Set agent fields for %s", service);
if (netconfig_is_wifi_profile(service) != TRUE) {
netconfig_error_dbus_method_return(context, NETCONFIG_ERROR_WRONG_PROFILE, "InvalidService");
- return reply;
+ return TRUE;
}
updated = __netconfig_create_config(fields);
if (result != TRUE)
ERR("Fail to connect %s", service);
- else
- reply = TRUE;
- return reply;
+ return TRUE;
}
gboolean handle_delete_eap_config(Wifi *wifi, GDBusMethodInvocation *context,
const gchar *profile)
{
- g_return_val_if_fail(wifi != NULL, FALSE);
+ g_return_val_if_fail(wifi != NULL, TRUE);
wifi_complete_delete_eap_config(wifi, context);
- gboolean ret = __netconfig_delete_config((const char *)profile);
+ __netconfig_delete_config((const char *)profile);
- return ret;
+ return TRUE;
}