Skip to content
Permalink
Browse files

mate-dictionary: Fix memory leak

  • Loading branch information...
sc0w committed Sep 24, 2018
1 parent d541d6e commit 2f8d89d7f455c6e229ebb12ed290335bdb535fe5
Showing with 9 additions and 6 deletions.
  1. +9 −6 mate-dictionary/src/gdict-pref-dialog.c
@@ -459,19 +459,22 @@ static void
font_button_font_set_cb (GtkWidget *font_button,
GdictPrefDialog *dialog)
{
const char *font;
gchar *font;

font = gtk_font_chooser_get_font (GTK_FONT_CHOOSER (font_button));
if (!font || font[0] == '\0')
return;

if (g_strcmp0 (dialog->print_font, font) == 0)
return;

if (!font || font[0] == '\0' || g_strcmp0 (dialog->print_font, font) == 0)
{
g_free (font);
return;
}

g_free (dialog->print_font);
dialog->print_font = g_strdup (font);

g_settings_set_string (dialog->settings, GDICT_SETTINGS_PRINT_FONT_KEY, dialog->print_font);

g_free (font);
}

static void

0 comments on commit 2f8d89d

Please sign in to comment.
You can’t perform that action at this time.