aboutsummaryrefslogtreecommitdiff
path: root/backend/multi
diff options
context:
space:
mode:
Diffstat (limited to 'backend/multi')
-rw-r--r--backend/multi/backend.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/backend/multi/backend.c b/backend/multi/backend.c
index 290b9678..33b26a0a 100644
--- a/backend/multi/backend.c
+++ b/backend/multi/backend.c
@@ -120,6 +120,12 @@ void wlr_multi_backend_add(struct wlr_backend *_multi,
wlr_log(L_ERROR, "Could not add backend: allocation failed");
return;
}
+ if (list_add(multi->backends, sub) == -1) {
+ wlr_log(L_ERROR, "Could not add backend: allocation failed");
+ free(sub);
+ return;
+ }
+
sub->backend = backend;
sub->container = &multi->backend;
@@ -137,8 +143,6 @@ void wlr_multi_backend_add(struct wlr_backend *_multi,
wl_signal_add(&backend->events.input_remove, &sub->input_remove);
wl_signal_add(&backend->events.output_add, &sub->output_add);
wl_signal_add(&backend->events.output_remove, &sub->output_remove);
-
- list_add(multi->backends, sub);
}
struct wlr_session *wlr_multi_get_session(struct wlr_backend *_backend) {