[PATCH] glamor: Fix leak of converted_bits in _glamor_upload_bits_to_pixmap_texture

Michel Dänzer michel at daenzer.net
Wed Sep 24 00:48:10 PDT 2014


From: Michel Dänzer <michel.daenzer at amd.com>

==9530== 808,575,600 bytes in 5,904 blocks are definitely lost in loss record 4,602 of 4,602
==9530==    at 0x4C28C20: malloc (vg_replace_malloc.c:296)
==9530==    by 0xAD29C98: _glamor_upload_bits_to_pixmap_texture (glamor_pixmap.c:771)
==9530==    by 0xAD2AE95: glamor_upload_sub_pixmap_to_texture (glamor_pixmap.c:1031)
==9530==    by 0xAD2BD55: glamor_upload_pixmap_to_texture (glamor_pixmap.c:1057)
==9530==    by 0xAD1C2E6: glamor_composite_choose_shader (glamor_render.c:1025)
==9530==    by 0xAD1C629: glamor_composite_with_shader (glamor_render.c:1174)
==9530==    by 0xAD1DA77: glamor_composite_clipped_region (glamor_render.c:1542)
==9530==    by 0xAD1E849: _glamor_composite (glamor_render.c:1689)
==9530==    by 0xAD1ED90: glamor_composite (glamor_render.c:1758)
==9530==    by 0x519FD6: damageComposite (damage.c:502)
==9530==    by 0xAD27AA3: glamor_trapezoids (glamor_trapezoid.c:147)
==9530==    by 0xAD27B51: glamor_trapezoids (glamor_trapezoid.c:101)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84176
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---

Maybe more could be done per the XXX comment in that function?

 glamor/glamor_pixmap.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/glamor/glamor_pixmap.c b/glamor/glamor_pixmap.c
index 11e9ebb..355fe4b 100644
--- a/glamor/glamor_pixmap.c
+++ b/glamor/glamor_pixmap.c
@@ -774,6 +774,7 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format,
             return FALSE;
         bits = glamor_color_convert_to_bits(bits, converted_bits, w, h,
                                             stride, no_alpha, revert, swap_rb);
+        free(converted_bits);
         if (bits == NULL) {
             ErrorF("Failed to convert pixmap no_alpha %d,"
                    "revert mode %d, swap mode %d\n", no_alpha, revert, swap_rb);
-- 
2.1.1



More information about the xorg-devel mailing list