weston: Properly test for output-creation failure
authorDaniel Stone <daniels@collabora.com>
Tue, 11 Jun 2019 10:32:14 +0000 (11:32 +0100)
committerSimon Ser <contact@emersion.fr>
Tue, 11 Jun 2019 10:36:55 +0000 (10:36 +0000)
We were testing the wrong variable to see if output creation had failed:
instead of testing the return of the function we'd just called, we were
testing something we'd already checked earlier.

Signed-off-by: Daniel Stone <daniels@collabora.com>
compositor/main.c

index bf4062afd012ed4c5701dceab94685f852b9d38a..1289327bcee46962bb7b06bafc1c3e217c319d81 100644 (file)
@@ -1818,7 +1818,7 @@ wet_layoutput_create_output(struct wet_layoutput *lo, const char *name)
        output->output =
                weston_compositor_create_output(lo->compositor->compositor,
                                                name);
-       if (!output) {
+       if (!output->output) {
                free(output);
                return NULL;
        }