commit 91d2a505b28f44f5d0fbb7fd63e9f56e74bf12eb
parent 3b5a8cb40d4ab07aa9a72ba87660e4b9801afa21
Author: Chang Liu <cliu712@aucklanduni.ac.nz>
Date: Tue, 12 Apr 2016 11:11:26 +1200
Plug two memory leaks
Plug two memory leaks introduced in the border drawing code.
Diffstat:
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/sway/border.c b/sway/border.c
@@ -86,6 +86,8 @@ int get_font_text_height(const char *font) {
cairo_t *cr = cairo_create(surface);
int width, height;
get_text_size(cr, font, &width, &height, "Gg");
+ cairo_surface_destroy(surface);
+ cairo_destroy(cr);
return height;
}
diff --git a/sway/container.c b/sway/container.c
@@ -64,6 +64,7 @@ static void free_swayc(swayc_t *cont) {
if (cont->bg_pid != 0) {
terminate_swaybg(cont->bg_pid);
}
+ free(cont->border);
free(cont);
}