dissect: do not trigger assertion on error

recurse_dir() does not provide 'sx' on error.

Fixes #25862.
This commit is contained in:
Yu Watanabe
2022-12-26 16:41:17 +09:00
parent 167f2c1a2b
commit 5ffa6a0af4

View File

@@ -901,11 +901,12 @@ static int mtree_print_item(
int r;
assert(path);
assert(sx);
if (IN_SET(event, RECURSE_DIR_ENTER, RECURSE_DIR_ENTRY)) {
_cleanup_free_ char *escaped = NULL;
assert(sx);
if (isempty(path))
path = ".";
else {