GNOME Bugzilla – Bug 768994
Memory leak in vte_terminal_set_colors()
Last modified: 2016-07-24 17:09:55 UTC
valgrind reports memory leak of 96 bytes in the following code line: vte_terminal_set_colors (VTE_TERMINAL (screen->terminal), has_fg ? &fg : NULL, has_bg ? &bg : NULL, palette, 16); The leak disappears if I pass 0 as palette_size (the last parameter). The leak seems to come from here: vtegtk.cc:2888 vte::color::rgb* pal = nullptr; if (palette_size) { pal = g_new0(vte::color::rgb, palette_size); for (gsize i = 0; i < palette_size; ++i) pal[i] = vte::color::rgb(palette[i]); } auto impl = IMPL(terminal); impl->set_colors(foreground ? &fg : nullptr, background ? &bg : nullptr, pal, palette_size); impl->set_background_alpha(background ? background->alpha : 1.0); pal does not get freed.
Thanks, fixed on master & 0-44.