talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 65b412d59d4e147cfd0a7e261a2de863f1bc1e22
parent b152fc03c3697d83a5ea96a901a90f265ea6ba0f
Author: wwp <subscript@free.fr>
Date:   Mon, 27 Sep 2021 18:26:59 +0200

Fix CID 1491085: (possible) use after free.

Diffstat:
Msrc/prefs_toolbar.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/prefs_toolbar.c b/src/prefs_toolbar.c @@ -1319,13 +1319,14 @@ static void set_visible_if_not_text(GtkTreeViewColumn *col, gtk_tree_model_get(model, iter, SET_ICON, &pixbuf, -1); - /* note getting a pixbuf from a tree model increases + /* note: getting a pixbuf from a tree model increases * its refcount ... */ - if (pixbuf != NULL) - g_object_unref(pixbuf); g_object_set(renderer, "visible", TRUE, NULL); g_object_set(renderer, "pixbuf", pixbuf, NULL); + + if (pixbuf != NULL) + g_object_unref(pixbuf); } }