diff options
author | Pablo Barciela <[email protected]> | 2018-12-05 19:46:27 +0100 |
---|---|---|
committer | ZenWalker <[email protected]> | 2018-12-06 15:55:44 +0100 |
commit | e8cbd69cc430cb184d20f34c8a26bac294fa946b (patch) | |
tree | 91dd62a342033c6425880b3a378acef9b1cb2616 | |
parent | 4e1d4d682af2f75b0ed6d2b9f6ddd7d053507d86 (diff) | |
download | pluma-e8cbd69cc430cb184d20f34c8a26bac294fa946b.tar.bz2 pluma-e8cbd69cc430cb184d20f34c8a26bac294fa946b.tar.xz |
pluma-window: Fix memory leaks
'g_strconcat' needs to be freed
-rw-r--r-- | pluma/pluma-window.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/pluma/pluma-window.c b/pluma/pluma-window.c index 771f3a4e..718a507e 100644 --- a/pluma/pluma-window.c +++ b/pluma/pluma-window.c @@ -328,7 +328,11 @@ 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)) { @@ -336,7 +340,11 @@ pluma_window_key_press_event (GtkWidget *widget, 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")) |