1.1 --- a/libe2access/lib/src/image.c Sat Oct 22 23:51:52 2022 +0200
1.2 +++ b/libe2access/lib/src/image.c Sun Oct 23 00:42:08 2022 +0200
1.3 @@ -237,7 +237,6 @@
1.4 errcode_t image_resolve_by_path(ext2_filsys fs, const char **path,
1.5 ext2_ino_t *ino)
1.6 {
1.7 - char *buf;
1.8 ext2_ino_t ino_dir;
1.9 errcode_t retval;
1.10
1.11 @@ -245,11 +244,6 @@
1.12
1.13 *ino = 0;
1.14
1.15 - retval = ext2fs_get_mem(fs->blocksize, &buf);
1.16 -
1.17 - if (retval)
1.18 - return retval;
1.19 -
1.20 /* Skip any leading root marker. */
1.21
1.22 if (**path == '/')
1.23 @@ -266,7 +260,7 @@
1.24
1.25 while (**path)
1.26 {
1.27 - retval = image_resolve_next(fs, ino_dir, path, buf, ino);
1.28 + retval = image_resolve_next(fs, ino_dir, path, 0, ino);
1.29 if (retval)
1.30 {
1.31 *ino = ino_dir;
1.32 @@ -278,8 +272,6 @@
1.33 ino_dir = *ino;
1.34 }
1.35
1.36 - ext2fs_free_mem(&buf);
1.37 -
1.38 return retval;
1.39 }
1.40
1.41 @@ -323,17 +315,7 @@
1.42 errcode_t image_find_file_by_inode(ext2_filsys fs, ext2_ino_t ino_parent,
1.43 const char *basename, ext2_ino_t *ino)
1.44 {
1.45 - char *buf;
1.46 - errcode_t retval = ext2fs_get_mem(fs->blocksize, &buf);
1.47 -
1.48 - if (retval)
1.49 - return retval;
1.50 -
1.51 - retval = ext2fs_lookup(fs, ino_parent, basename, strlen(basename), buf, ino);
1.52 -
1.53 - ext2fs_free_mem(&buf);
1.54 -
1.55 - return retval;
1.56 + return ext2fs_lookup(fs, ino_parent, basename, strlen(basename), 0, ino);
1.57 }
1.58
1.59 /* Obtain the inode for the object with the given path. */
1.60 @@ -381,38 +363,26 @@
1.61 void *),
1.62 void *data)
1.63 {
1.64 - char *buf;
1.65 ext2_ino_t ino;
1.66 errcode_t retval;
1.67
1.68 - retval = ext2fs_get_mem(fs->blocksize, &buf);
1.69 - if (retval)
1.70 - return retval;
1.71 -
1.72 /* Locate the object and test whether it is a directory. */
1.73
1.74 retval = image_find_by_path(fs, path, &ino);
1.75
1.76 if (retval)
1.77 - {
1.78 - ext2fs_free_mem(&buf);
1.79 return retval;
1.80 - }
1.81
1.82 if (!image_isdir_by_inode(fs, ino))
1.83 return 1;
1.84
1.85 /* List the directory contents. */
1.86
1.87 - retval = ext2fs_dir_iterate(fs, ino, 0, buf, proc, data);
1.88 + retval = ext2fs_dir_iterate(fs, ino, 0, 0, proc, data);
1.89
1.90 if (retval)
1.91 - {
1.92 - ext2fs_free_mem(&buf);
1.93 return retval;
1.94 - }
1.95
1.96 - ext2fs_free_mem(&buf);
1.97 return 0;
1.98 }
1.99