aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2017-11-01 20:59:28 +0100
committerDominique Martinet <asmadeus@codewreck.org>2017-11-01 21:14:23 +0100
commit844b166c1bed117ef654de3f9ad68eebad67f6be (patch)
tree4a1192cbe8fa7ec6bfc4520a93cc66e2a951f031
parent4f73498b78645728ff23adfbf9b650a1b66b66bb (diff)
multi_backend_destroy: fix trivial use-after-free
-rw-r--r--backend/multi/backend.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/multi/backend.c b/backend/multi/backend.c
index a7ee648c..c35303e0 100644
--- a/backend/multi/backend.c
+++ b/backend/multi/backend.c
@@ -30,8 +30,8 @@ static bool multi_backend_start(struct wlr_backend *_backend) {
static void multi_backend_destroy(struct wlr_backend *_backend) {
struct wlr_multi_backend *backend = (struct wlr_multi_backend *)_backend;
- struct subbackend_state *sub;
- wl_list_for_each(sub, &backend->backends, link) {
+ struct subbackend_state *sub, *next;
+ wl_list_for_each_safe(sub, next, &backend->backends, link) {
wlr_backend_destroy(sub->backend);
free(sub);
}