summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorVitaly Kirsanov <krokoziabla@gmail.com>2017-09-13 13:07:00 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2018-04-25 15:51:50 +0100
commita17ef43a3c25e09d33a686ba3575667eaf084760 (patch)
tree24a422d00464e6c27049509b9d37092d325ee05f /gdk-pixbuf
parent76d439848a66310e63a925ca305cf7aae7aef069 (diff)
downloadgdk-pixbuf-a17ef43a3c25e09d33a686ba3575667eaf084760.tar.gz
Plug a memory leak when using GBytes
Calling g_bytes_unref_to_data() will copy the contents of the bytes buffer, so we need to free the data. https://bugzilla.gnome.org/show_bug.cgi?id=787626
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/gdk-pixbuf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gdk-pixbuf/gdk-pixbuf.c b/gdk-pixbuf/gdk-pixbuf.c
index a0454c33e..c86d09678 100644
--- a/gdk-pixbuf/gdk-pixbuf.c
+++ b/gdk-pixbuf/gdk-pixbuf.c
@@ -715,6 +715,8 @@ gdk_pixbuf_get_pixels_with_length (const GdkPixbuf *pixbuf,
gsize len;
mut_pixbuf->pixels = g_bytes_unref_to_data (pixbuf->bytes, &len);
mut_pixbuf->bytes = NULL;
+ mut_pixbuf->destroy_fn = free_buffer;
+ mut_pixbuf->destroy_fn_data = NULL;
}
if (length)