toytoolkit: Return NULL when no outputs are present
authorArmin Krezović <krezovic.armin@gmail.com>
Thu, 23 Jun 2016 09:59:31 +0000 (11:59 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 27 Jun 2016 10:17:05 +0000 (13:17 +0300)
commit7dda25b2d5ec6e79561d9e558b21e0230166605b
treea3b08367c43f1eb264cd3f8f9c5761a313216427
parent10b0618c07091cf8caed853667e3b0eb7b070ec8
toytoolkit: Return NULL when no outputs are present

Currently, display_get_output returns a first member
of the linked list, which can never be NULL.

This is problematic, as the function would return a
dangling pointer and NULL pointer checks wouldn't
work where needed and some of the invalid members
would get accessed that way, resulting in a crash.

Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Signed-off-by: Armin Krezović <krezovic.armin@gmail.com>
clients/window.c