summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--unpack/restore_fstree.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/unpack/restore_fstree.c b/unpack/restore_fstree.c
index 8aa283c..1dadce4 100644
--- a/unpack/restore_fstree.c
+++ b/unpack/restore_fstree.c
@@ -9,14 +9,17 @@
static int create_node(const sqfs_tree_node_t *n, int flags)
{
const sqfs_tree_node_t *c;
+ int fd, ret;
char *name;
- int fd;
if (!(flags & UNPACK_QUIET)) {
name = sqfs_tree_node_get_path(n);
- canonicalize_name(name);
- printf("creating %s\n", name);
- free(name);
+ if (name != NULL) {
+ ret = canonicalize_name(name);
+ assert(ret == 0);
+ printf("creating %s\n", name);
+ free(name);
+ }
}
switch (n->inode->base.mode & S_IFMT) {