Skip to content

Commit 91d2a50

Browse files
committed
Plug two memory leaks
Plug two memory leaks introduced in the border drawing code.
1 parent 3b5a8cb commit 91d2a50

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

sway/border.c

+2
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ int get_font_text_height(const char *font) {
8686
cairo_t *cr = cairo_create(surface);
8787
int width, height;
8888
get_text_size(cr, font, &width, &height, "Gg");
89+
cairo_surface_destroy(surface);
90+
cairo_destroy(cr);
8991
return height;
9092
}
9193

sway/container.c

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ static void free_swayc(swayc_t *cont) {
6464
if (cont->bg_pid != 0) {
6565
terminate_swaybg(cont->bg_pid);
6666
}
67+
free(cont->border);
6768
free(cont);
6869
}
6970

0 commit comments

Comments
 (0)