From 8221c487edae1b8202e0fe40304c16b0570d467e Mon Sep 17 00:00:00 2001 From: Simon Zeni Date: Mon, 8 Apr 2024 10:12:54 -0400 Subject: [PATCH] xcursor/wlr_xcursor: properly clean xcursor in case of realloc failure in load_callback --- xcursor/wlr_xcursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcursor/wlr_xcursor.c b/xcursor/wlr_xcursor.c index c57d8175..33729f1f 100644 --- a/xcursor/wlr_xcursor.c +++ b/xcursor/wlr_xcursor.c @@ -187,7 +187,7 @@ static void load_callback(struct xcursor_images *images, void *data) { theme->cursor_count * sizeof(theme->cursors[0])); if (cursors == NULL) { theme->cursor_count--; - free(cursor); + xcursor_destroy(cursor); } else { theme->cursors = cursors; theme->cursors[theme->cursor_count - 1] = cursor;