diff options
author | Rob Landley <rob@landley.net> | 2023-02-06 06:05:36 -0600 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2023-02-06 06:05:36 -0600 |
commit | 8cee8c278a88d134ce2a0ece12b31f83e261677e (patch) | |
tree | 11fba69b6112a1d791d9a890f04dbbdd0dbd28a5 /toys/posix/tar.c | |
parent | 71b95f7ae8ae5cef495cc481bdea7da42c524e13 (diff) | |
download | toybox-8cee8c278a88d134ce2a0ece12b31f83e261677e.tar.gz |
Fix a couple tar --sort leaks.
Diffstat (limited to 'toys/posix/tar.c')
-rw-r--r-- | toys/posix/tar.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/tar.c b/toys/posix/tar.c index 1b325309..3a399863 100644 --- a/toys/posix/tar.c +++ b/toys/posix/tar.c @@ -287,7 +287,7 @@ static int add_to_tar(struct dirtree *node) free(name); return DIRTREE_BREADTH; - } else if (node->again&DIRTREE_BREADTH) { + } else if ((node->again&DIRTREE_BREADTH) && node->child) { struct dirtree *dt, **sort = xmalloc(sizeof(void *)*node->extra); for (node->extra = 0, dt = node->child; dt; dt = dt->next) |