commit b4a80787218ddf6b2ed728cbc16eeb4519816a72
parent d845ea3991d780129963db79a2891a0bf0aee3fa
Author: wwp <subscript@free.fr>
Date: Mon, 27 Sep 2021 18:26:59 +0200
Fix CID 1491085: (possible) use after free.
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/prefs_toolbar.c b/src/prefs_toolbar.c
@@ -1304,13 +1304,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);
}
}