talons

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

commit 45bb7c40cc009d2c13244660ef21855dac48ca51
parent d5e5f0ce0c82ee9772235204e7c93415e234e254
Author: Jonathan Boeing <jonathan@claws-mail.org>
Date:   Fri, 24 Sep 2021 08:21:06 -0700

Fix memory leak

Diffstat:
Msrc/gtk/gtkutils.c | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gtk/gtkutils.c b/src/gtk/gtkutils.c @@ -1077,6 +1077,8 @@ GtkWidget *xface_get_from_header(const gchar *o_xface) { static gchar *xpm_xface[XPM_XFACE_HEIGHT]; static gboolean xpm_xface_init = TRUE; + GdkPixbuf *pixbuf; + GtkWidget *ret; gchar xface[2048]; if (o_xface == NULL) @@ -1102,8 +1104,11 @@ GtkWidget *xface_get_from_header(const gchar *o_xface) create_xpm_from_xface(xpm_xface, xface); - return gtk_image_new_from_pixbuf( - gdk_pixbuf_new_from_xpm_data((const char **)xpm_xface)); + pixbuf = gdk_pixbuf_new_from_xpm_data((const char **)xpm_xface); + ret = gtk_image_new_from_pixbuf(pixbuf); + g_object_unref(pixbuf); + + return ret; } #endif