After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 768994 - Memory leak in vte_terminal_set_colors()
Memory leak in vte_terminal_set_colors()
Status: RESOLVED FIXED
Product: vte
Classification: Core
Component: general
0.44.x
Other Linux
: Normal normal
: ---
Assigned To: VTE Maintainers
VTE Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-07-20 14:06 UTC by Igor
Modified: 2016-07-24 17:09 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Igor 2016-07-20 14:06:08 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.
Comment 1 Egmont Koblinger 2016-07-24 17:09:55 UTC
Thanks, fixed on master & 0-44.