about summary refs log tree commit diff stats
path: root/src/config
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-06-17 21:02:48 +0100
committerJames Booth <boothj5@gmail.com>2014-06-17 21:02:48 +0100
commit2f95340c3ab990014aef300bee5120c5d0e10a7e (patch)
treeda1178734a44892dc43e236ea5aa84d199e3d6ff /src/config
parent235c893f285103dd0925192ae12b69786647c165 (diff)
downloadprofani-tty-2f95340c3ab990014aef300bee5120c5d0e10a7e.tar.gz
Free GError on prefs load
Diffstat (limited to 'src/config')
-rw-r--r--src/config/preferences.c15
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();