]> git.sur5r.net Git - i3/i3lock/commitdiff
Fix a few memory leaks
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 3 Jan 2012 22:31:16 +0000 (22:31 +0000)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 3 Jan 2012 22:31:16 +0000 (22:31 +0000)
unlock_indicator.c
xcb.c

index de2e2c2b0af48f03e4fd19086ebc93058a102568..2d72cf205d4924611d0988911c8da86693a3a5db 100644 (file)
@@ -145,6 +145,8 @@ xcb_pixmap_t draw_image(uint32_t *resolution) {
         cairo_set_source(ctx, outer_pat);
         cairo_stroke(ctx);
 
+        cairo_pattern_destroy(outer_pat);
+
         /* Draw an inner seperator line. */
         cairo_set_source_rgb(ctx, 0, 0, 0);
         cairo_set_line_width(ctx, 2.0);
@@ -228,6 +230,7 @@ xcb_pixmap_t draw_image(uint32_t *resolution) {
                       highlight_start + (M_PI / 3.0) /* start */,
                       (highlight_start + (M_PI / 3.0)) + (M_PI / 128.0) /* end */);
             cairo_stroke(ctx);
+            cairo_pattern_destroy(outer_pat);
         }
     }
 
diff --git a/xcb.c b/xcb.c
index d27b98cf89ecd0e6de7862e1da538f581b1422aa..da2f937335d89300271a0c5937b8ac82d0e84a3e 100644 (file)
--- a/xcb.c
+++ b/xcb.c
@@ -172,6 +172,8 @@ uint32_t get_mod_mask(xcb_connection_t *conn, xcb_key_symbols_t *symbols, uint32
             }
         }
 
+    free(modeswitchcodes);
+    free(modmap_r);
     return 0;
 }