Although it won't happen in reality except for bugs.
Fixes: 8f93c2f83962 ("erofs-utils: mkfs: support inline xattr reservation for
rootdirs")
Coverity-id: 507395
Signed-off-by: Gao Xiang <[email protected]>
---
lib/xattr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/xattr.c b/lib/xattr.c
index f860f2e..651657f 100644
--- a/lib/xattr.c
+++ b/lib/xattr.c
@@ -1020,6 +1020,7 @@ char *erofs_export_xattr_ibody(struct erofs_inode *inode)
memset(buf + p, 0, size - p);
} else if (__erofs_unlikely(p > size)) {
DBG_BUGON(1);
+ free(buf);
return ERR_PTR(-EFAULT);
}
return buf;
--
2.43.5