diff options
author | James Booth <boothj5@gmail.com> | 2014-06-17 21:02:48 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-06-17 21:02:48 +0100 |
commit | 2f95340c3ab990014aef300bee5120c5d0e10a7e (patch) | |
tree | da1178734a44892dc43e236ea5aa84d199e3d6ff /src/config | |
parent | 235c893f285103dd0925192ae12b69786647c165 (diff) | |
download | profani-tty-2f95340c3ab990014aef300bee5120c5d0e10a7e.tar.gz |
Free GError on prefs load
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/preferences.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/config/preferences.c b/src/config/preferences.c index 6c41cdfa..7acd5a0d 100644 --- a/src/config/preferences.c +++ b/src/config/preferences.c @@ -82,22 +82,31 @@ prefs_load(void) // move pre 0.4.1 OTR preferences to [otr] group err = NULL; gboolean ui_otr_warn = g_key_file_get_boolean(prefs, PREF_GROUP_UI, "otr.warn", &err); - if (!err) { + if (err == NULL) { g_key_file_set_boolean(prefs, PREF_GROUP_OTR, _get_key(PREF_OTR_WARN), ui_otr_warn); g_key_file_remove_key(prefs, PREF_GROUP_UI, "otr.warn", NULL); + } else { + g_error_free(err); } + err = NULL; gchar *ui_otr_log = g_key_file_get_string(prefs, PREF_GROUP_LOGGING, "otr", &err); - if (!err) { + if (err == NULL) { g_key_file_set_string(prefs, PREF_GROUP_OTR, _get_key(PREF_OTR_LOG), ui_otr_log); g_key_file_remove_key(prefs, PREF_GROUP_LOGGING, "otr", NULL); + } else { + g_error_free(err); } + err = NULL; gchar *ui_otr_policy = g_key_file_get_string(prefs, "policy", "otr.policy", &err); - if (!err) { + if (err == NULL) { g_key_file_set_string(prefs, PREF_GROUP_OTR, _get_key(PREF_OTR_POLICY), ui_otr_policy); g_key_file_remove_group(prefs, "policy", NULL); + } else { + g_error_free(err); } + _save_prefs(); boolean_choice_ac = autocomplete_new(); |