aboutsummaryrefslogtreecommitdiff
path: root/xcursor
diff options
context:
space:
mode:
authorKirill Primak <vyivel@eclair.cafe>2023-11-19 13:45:05 +0300
committerKirill Primak <vyivel@eclair.cafe>2023-11-19 15:33:39 +0300
commite16b0068a70b6d2cf57177de197e9b171e39bb78 (patch)
tree48adfe8471e0437f482a0c551c2039b481dda8f1 /xcursor
parentb06d58fa8b6bb5d9a154f795ec595477e13998bc (diff)
xcursor: fix NULL deref on malloc() fail
Diffstat (limited to 'xcursor')
-rw-r--r--xcursor/xcursor.c8
1 files 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");