summaryrefslogtreecommitdiff
path: root/sway/tree/view.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/view.c')
-rw-r--r--sway/tree/view.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c
index c0984ca4..648c1655 100644
--- a/sway/tree/view.c
+++ b/sway/tree/view.c
@@ -43,13 +43,10 @@ void view_destroy(struct sway_view *view) {
}
list_free(view->marks);
- if (view->marks_focused) {
- // If one is set then all of these are set
- wlr_texture_destroy(view->marks_focused);
- wlr_texture_destroy(view->marks_focused_inactive);
- wlr_texture_destroy(view->marks_unfocused);
- wlr_texture_destroy(view->marks_urgent);
- }
+ wlr_texture_destroy(view->marks_focused);
+ wlr_texture_destroy(view->marks_focused_inactive);
+ wlr_texture_destroy(view->marks_unfocused);
+ wlr_texture_destroy(view->marks_urgent);
container_destroy(view->swayc);
@@ -803,6 +800,11 @@ static void update_marks_texture(struct sway_view *view,
char *buffer = calloc(len + 1, 1);
char *part = malloc(len + 1);
+ if (!sway_assert(buffer && part, "Unable to allocate memory")) {
+ free(buffer);
+ return;
+ }
+
for (int i = 0; i < view->marks->length; ++i) {
char *mark = view->marks->items[i];
if (mark[0] != '_') {