From e16b0068a70b6d2cf57177de197e9b171e39bb78 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Sun, 19 Nov 2023 13:45:05 +0300 Subject: [PATCH] xcursor: fix NULL deref on malloc() fail --- xcursor/xcursor.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/xcursor/xcursor.c b/xcursor/xcursor.c index 46085918..7e1f310f 100644 --- a/xcursor/xcursor.c +++ b/xcursor/xcursor.c @@ -763,9 +763,11 @@ xcursor_load_theme(const char *theme, int size, continue; full = xcursor_build_fullname(dir, "cursors", ""); - load_all_cursors_from_dir(full, size, load_callback, - user_data); - free(full); + if (full) { + load_all_cursors_from_dir(full, size, load_callback, + user_data); + free(full); + } if (!inherits) { full = xcursor_build_fullname(dir, "", "index.theme");