aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-06-27 17:47:41 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-06-27 17:47:41 +1000
commit8773ed39701748ba5500b4698d028795aa6e812e (patch)
tree171f771887ad7bba4cb454031451ae37ebdbae13 /sway/tree
parentbe86d3aba602fef7b51fafa8a6e7a39d1e49817f (diff)
Fix memleak in container_get_box
Rather than allocate a structure and expect callers to free it, take a pointer to an existing struct as an argument. This function is no longer called anywhere though.
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index 8446c457..ab3d9dbd 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -988,11 +988,9 @@ bool container_is_floating(struct sway_container *container) {
return container->parent == workspace->sway_workspace->floating;
}
-struct wlr_box *container_get_box(struct sway_container *container) {
- struct wlr_box *box = calloc(1, sizeof(struct wlr_box));
+void container_get_box(struct sway_container *container, struct wlr_box *box) {
box->x = container->x;
box->y = container->y;
box->width = container->width;
box->height = container->height;
- return box;
}