Skip to content

Commit

Permalink
panel-plugin/title/windowck-title.c: fix memory leak on title change
Browse files Browse the repository at this point in the history
It seems the memory is allocated on every title change and never gets
freed. Glib says to use g_malloc() with g_free() (used below) and it
seems switching to g_malloc() fixes the memory leak.

Refs takinoy#30

Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
  • Loading branch information
invidian committed Aug 12, 2020
1 parent 61f49d4 commit 80e01c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion panel-plugin/title/windowck-title.c
Expand Up @@ -169,7 +169,7 @@ static void on_name_changed (WnckWindow *controlwindow, WindowckPlugin *wckp)
{
if (wckp->prefs->two_lines)
{
gchar *subtitle = malloc( sizeof(gchar) * ( strlen(title_text) + 1 ) );
gchar *subtitle = g_malloc( sizeof(gchar) * ( strlen(title_text) + 1 ) );
strcpy (subtitle, part[0]);
if (wckp->prefs->full_name)
{
Expand Down

0 comments on commit 80e01c8

Please sign in to comment.