glamor: Fix leak of converted_bits in _glamor_upload_bits_to_pixmap_texture

==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@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Michel Dänzer 2014-09-24 16:48:10 +09:00 committed by Keith Packard
parent cc59be38b7
commit 6e50bfa706

View File

@ -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);