Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
pluma-window: Fix memory leaks
'g_strconcat' needs to be freed
  • Loading branch information
sc0w committed Dec 6, 2018
1 parent 4e1d4d6 commit e8cbd69
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pluma/pluma-window.c
Expand Up @@ -328,15 +328,23 @@ pluma_window_key_press_event (GtkWidget *widget,
sprintf (tempsize, "%d", nsize);

if (!g_settings_get_boolean (settings, "use-default-font") && (nsize < 73))
g_settings_set_string (settings, "editor-font", g_strconcat (tempfont, tempsize, NULL));
{
gchar *tmp = g_strconcat (tempfont, tempsize, NULL);
g_settings_set_string (settings, "editor-font", tmp);
g_free (tmp);
}
}
else if ((event->keyval == GDK_KEY_minus) || (event->keyval == GDK_KEY_KP_Subtract))
{
nsize = nsize - 1;
sprintf (tempsize, "%d", nsize);

if (!g_settings_get_boolean (settings, "use-default-font") && (nsize > 5))
g_settings_set_string (settings, "editor-font", g_strconcat (tempfont, tempsize, NULL));
{
gchar *tmp = g_strconcat (tempfont, tempsize, NULL);
g_settings_set_string (settings, "editor-font", tmp);
g_free (tmp);
}
}

if (g_settings_get_boolean (settings, "ctrl-tab-switch-tabs"))
Expand Down

0 comments on commit e8cbd69

Please sign in to comment.