diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-09-03 20:06:55 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-09-03 20:06:55 +0200 |
commit | 587759c6f26ab0b64f0baf1c03587d4f08042817 (patch) | |
tree | 8b8d0653b84e2b32ee81c57d9826e7e6aa51fa63 /bin/gensquashfs | |
parent | 40f0b3382e4ee286d5fbf8255c9ddfeef35a44e6 (diff) |
coverity: fix: use-after-free in error path
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin/gensquashfs')
-rw-r--r-- | bin/gensquashfs/src/fstree_from_dir.c | 2 | ||||
-rw-r--r-- | bin/gensquashfs/src/glob.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/bin/gensquashfs/src/fstree_from_dir.c b/bin/gensquashfs/src/fstree_from_dir.c index defc8bf..40b4061 100644 --- a/bin/gensquashfs/src/fstree_from_dir.c +++ b/bin/gensquashfs/src/fstree_from_dir.c @@ -24,8 +24,8 @@ int fstree_from_dir(fstree_t *fs, sqfs_dir_iterator_t *dir) if (S_ISLNK(ent->mode)) { ret = dir->read_link(dir, &extra); if (ret) { - free(ent); sqfs_perror("readlink", ent->name, ret); + free(ent); return -1; } } diff --git a/bin/gensquashfs/src/glob.c b/bin/gensquashfs/src/glob.c index 7d37538..27b7baa 100644 --- a/bin/gensquashfs/src/glob.c +++ b/bin/gensquashfs/src/glob.c @@ -91,8 +91,8 @@ static int scan_directory(fstree_t *fs, sqfs_dir_iterator_t *dir, if (S_ISLNK(ent->mode)) { ret = dir->read_link(dir, &extra); if (ret) { - free(ent); sqfs_perror("readlink", ent->name, ret); + free(ent); return -1; } } else if (S_ISREG(ent->mode)) { |