Thannoy commented on this pull request.
@@ -118,9 +119,204 @@ void saveSettings(void)
ppo->indentChar = gtk_combo_box_get_active(GTK_COMBO_BOX(indentationChar))==0 ? '\t' : ' ';
breakStyle = gtk_combo_box_get_active(GTK_COMBO_BOX(lineBreak)); - if (breakStyle == 0) ppo->newLineChars = "\r"; - else if (breakStyle == 1) ppo->newLineChars = "\n"; - else ppo->newLineChars = "\r\n"; + if (ppo->newLineChars != NULL) + { + g_free ((gpointer)ppo->newLineChars);
(minor) freeing a NULL pointer is perfectly legal. There is no need to test nullity, you can use g_free unconditionally here. (see https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free)