Cage: check for sigchld_source being NULL before removing it

If something goes wrong during startup (i.e., the wlroots backend cannot
be created), we jump to the end. This then unconditionally removes the
sigchld_source, but that hasn't been set at this point yet.
This commit is contained in:
Jente Hidskes 2020-02-22 00:23:03 +01:00
parent e96fccfa54
commit 27391f174a
No known key found for this signature in database
GPG key ID: 04BE5A29F32D91EA

4
cage.c
View file

@ -495,7 +495,9 @@ end:
wl_event_source_remove(sigint_source);
wl_event_source_remove(sigterm_source);
wl_event_source_remove(sigchld_source);
if (sigchld_source) {
wl_event_source_remove(sigchld_source);
}
seat_destroy(server.seat);
/* This function is not null-safe, but we only ever get here
with a proper wl_display. */