From ac4fd65521a676dfd9b198af7434e1d1f1e48386 Mon Sep 17 00:00:00 2001 From: Enno Boland Date: Sat, 27 Jul 2024 23:44:22 +0200 Subject: [PATCH] easy/xattr: Return proper error code when malloc fails --- libsqsh/src/easy/xattr.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libsqsh/src/easy/xattr.c b/libsqsh/src/easy/xattr.c index 68ef651d..10de5492 100644 --- a/libsqsh/src/easy/xattr.c +++ b/libsqsh/src/easy/xattr.c @@ -71,6 +71,10 @@ sqsh_easy_xattr_get( } xattr_value = sqsh_xattr_iterator_value_dup(&iterator); + if (xattr_value == NULL) { + rv = -SQSH_ERROR_MALLOC_FAILED; + goto out; + } out: sqsh__xattr_iterator_cleanup(&iterator);