video_output/xcb: fix memory-leak in ReleaseDrawable
commit66dc09662ae33d44c21a5159885afdcaabb0cbb0
authorFilip Roséen <filip@atch.se>
Fri, 23 Sep 2016 11:52:31 +0000 (23 13:52 +0200)
committerThomas Guillem <thomas@gllm.fr>
Fri, 23 Sep 2016 14:03:13 +0000 (23 16:03 +0200)
tree65bb89edbb04086aef16ec6102c1aadbb43f2114
parent287539568996c44b881c1fe97e0442128f056f20
video_output/xcb: fix memory-leak in ReleaseDrawable

The problem with the previous implementation is that "n" will never
be equal to 0 at the relevant part of the code (given the
unconditional pre-increment a few lines earlier).

These changes fixes the issue by freeing the allocated memory if the
first element of "used" is NULL (meaning that there are no more
entities referred to by it).

fixes #17112
fixes #17293

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
modules/video_output/xcb/window.c