aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toys/posix/ps.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/ps.c b/toys/posix/ps.c
index 4f8d75a9..b204962b 100644
--- a/toys/posix/ps.c
+++ b/toys/posix/ps.c
@@ -1075,8 +1075,8 @@ static struct carveup **collate_leaves(struct carveup **tb, struct dirtree *dt)
while (dt) {
struct dirtree *next = dt->next;
+ if (dt->extra) *(tb++) = (void *)dt->extra;
if (dt->child) tb = collate_leaves(tb, dt->child);
- else *(tb++) = (void *)dt->extra;
free(dt);
dt = next;
}