diff options
author | 2016-04-12 11:11:26 +1200 | |
---|---|---|
committer | 2016-04-12 12:35:50 +1200 | |
commit | 91d2a505b28f44f5d0fbb7fd63e9f56e74bf12eb (patch) | |
tree | 515f35605dc060fe8ce0ce4986b674acf4eef30e /sway | |
parent | Merge pull request #580 from mikkeloscar/handle-realloc-fail (diff) | |
download | sway-91d2a505b28f44f5d0fbb7fd63e9f56e74bf12eb.tar.gz sway-91d2a505b28f44f5d0fbb7fd63e9f56e74bf12eb.tar.zst sway-91d2a505b28f44f5d0fbb7fd63e9f56e74bf12eb.zip |
Plug two memory leaks
Plug two memory leaks introduced in the border drawing code.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/border.c | 2 | ||||
-rw-r--r-- | sway/container.c | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/sway/border.c b/sway/border.c index 6343ddd0..411c0427 100644 --- a/sway/border.c +++ b/sway/border.c | |||
@@ -86,6 +86,8 @@ int get_font_text_height(const char *font) { | |||
86 | cairo_t *cr = cairo_create(surface); | 86 | cairo_t *cr = cairo_create(surface); |
87 | int width, height; | 87 | int width, height; |
88 | get_text_size(cr, font, &width, &height, "Gg"); | 88 | get_text_size(cr, font, &width, &height, "Gg"); |
89 | cairo_surface_destroy(surface); | ||
90 | cairo_destroy(cr); | ||
89 | return height; | 91 | return height; |
90 | } | 92 | } |
91 | 93 | ||
diff --git a/sway/container.c b/sway/container.c index 6dfc608d..a4b2d1c2 100644 --- a/sway/container.c +++ b/sway/container.c | |||
@@ -64,6 +64,7 @@ static void free_swayc(swayc_t *cont) { | |||
64 | if (cont->bg_pid != 0) { | 64 | if (cont->bg_pid != 0) { |
65 | terminate_swaybg(cont->bg_pid); | 65 | terminate_swaybg(cont->bg_pid); |
66 | } | 66 | } |
67 | free(cont->border); | ||
67 | free(cont); | 68 | free(cont); |
68 | } | 69 | } |
69 | 70 | ||