aboutsummaryrefslogtreecommitdiff
path: root/backend/backend.c
diff options
context:
space:
mode:
authorDominique Martinet <asmadeus@codewreck.org>2018-06-30 11:11:06 +0900
committerDominique Martinet <asmadeus@codewreck.org>2018-06-30 11:45:57 +0900
commite5348ad7d374713d4e1a386849b15fb0d68de31c (patch)
treebaaf7e9122910a4ba5ea4dc215117c22e4986e8b /backend/backend.c
parent1940c6bbd9c0a8867e40a36f27b69c7069213cf0 (diff)
backend autocreate: fix leak when WLR_BACKENDS is set
Found through static analysis
Diffstat (limited to 'backend/backend.c')
-rw-r--r--backend/backend.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/backend/backend.c b/backend/backend.c
index 07c171bc..07e05fca 100644
--- a/backend/backend.c
+++ b/backend/backend.c
@@ -203,6 +203,7 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
wlr_log(L_ERROR, "failed to start backend '%s'", name);
wlr_backend_destroy(backend);
wlr_session_destroy(session);
+ free(names);
return NULL;
}
@@ -210,12 +211,14 @@ struct wlr_backend *wlr_backend_autocreate(struct wl_display *display,
wlr_log(L_ERROR, "failed to add backend '%s'", name);
wlr_backend_destroy(backend);
wlr_session_destroy(session);
+ free(names);
return NULL;
}
name = strtok_r(NULL, ",", &saveptr);
}
+ free(names);
return backend;
}