Skip to content
Commit c56e69bc authored by Michael Tretter's avatar Michael Tretter
Browse files

ivi-shell: fix free in get_layers_under_surface



If a controller requests the layers under a surface that has no views attached,
Weston crashes since it tries to free the array that would be used to return the
found layers, but has not been allocated before.

Free the ppArray only if it was allocated in ivi_layout_get_layers_under_surface
before and no layers were found.

While at it, make it obvious that checking the length is an integer comparison
by comparing it to 0.

Signed-off-by: Michael Tretter's avatarMichael Tretter <m.tretter@pengutronix.de>
parent 2f0be4b4
Loading
Loading
Loading
Pipeline #717809 passed with stages
in 3 minutes and 4 seconds
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment