talons

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

commit 5b1a3ab9df6341785aab28584454b05be3ad7042
parent a4bf73918d3e97dcb75aac791d1aa445e59db85e
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 @@ -1087,6 +1087,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) @@ -1112,8 +1114,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