summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-06 19:25:31 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-10-06 19:28:41 +0200
commit7c6f0fa3836d9ede71a15917a3efc1f013d60d6d (patch)
treebba68a4391fe89401a2c22b3001b8af3469ab907
parent7fb91aa5872a79ab94a9adae6ca72f1b1d0f8e36 (diff)
Fix missing error checking in diagnostic printing
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-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) {