[PATCH weston] comp-wayland: use safe foreach when destroying outputs

Thierry Reding thierry.reding at gmail.com
Wed May 21 15:22:00 PDT 2014


On Wed, May 21, 2014 at 09:20:02AM -0700, U. Artie Eoff wrote:
> wl_list_for_each dereference's output to increment the
> next iteration of the loop.  However, output is free'd
> inside the loop resulting in a dereference to free'd
> memory.
> 
> Use wl_list_for_each_safe instead, which is designed to
> handle this kind of pattern.
> 
> Signed-off-by: U. Artie Eoff <ullysses.a.eoff at intel.com>
> ---
>  src/compositor-wayland.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Thierry Reding <thierry.reding at gmail.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20140522/0b98bf70/attachment.sig>


More information about the wayland-devel mailing list