glamor: Don't free memory we are going to use.
glamor_color_convert_to_bits() returns its second argument on
success, NULL on error, and need_free_bits already makes sure that
"bits" aliasing converted_bits is freed in the success case.
Looks like the memory leak that was supposed to be fixed in
6e50bfa706
only occurred in the error
case.
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
16a32c53f6
commit
55b27ed70c
|
@ -774,8 +774,8 @@ _glamor_upload_bits_to_pixmap_texture(PixmapPtr pixmap, GLenum format,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
bits = glamor_color_convert_to_bits(bits, converted_bits, w, h,
|
bits = glamor_color_convert_to_bits(bits, converted_bits, w, h,
|
||||||
stride, no_alpha, revert, swap_rb);
|
stride, no_alpha, revert, swap_rb);
|
||||||
free(converted_bits);
|
|
||||||
if (bits == NULL) {
|
if (bits == NULL) {
|
||||||
|
free(converted_bits);
|
||||||
ErrorF("Failed to convert pixmap no_alpha %d,"
|
ErrorF("Failed to convert pixmap no_alpha %d,"
|
||||||
"revert mode %d, swap mode %d\n", no_alpha, revert, swap_rb);
|
"revert mode %d, swap mode %d\n", no_alpha, revert, swap_rb);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in New Issue