From 711bbd9de97ff3df672690042000df9f753ab8bd Mon Sep 17 00:00:00 2001 From: Martin Trojer Date: Wed, 28 Oct 2026 07:23:31 +0000 Subject: main: destroy replaced image surface with cairo_surface_destroy A later -i for the same output replaces the earlier image, but the old cairo surface was released with free(), leaking its pixel buffer. --- main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 9e6401f..27ac27b 100644 --- a/main.c +++ b/main.c @@ -364,7 +364,7 @@ static void load_image(char *arg, struct swaylock_state *state) { image->path); } wl_list_remove(&iter_image->link); - free(iter_image->cairo_surface); + cairo_surface_destroy(iter_image->cairo_surface); free(iter_image->output_name); free(iter_image->path); free(iter_image); -- cgit v1.2.3