aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ext2fs/dir_iterate.c
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>1997-10-26 03:41:24 +0000
committerTheodore Ts'o <tytso@mit.edu>1997-10-26 03:41:24 +0000
commit7b4e4534f9361b21d3fafdd88a58f133decee38c (patch)
treedb28490bbca280ffd8d74dcfa64ed7cba508cbbf /lib/ext2fs/dir_iterate.c
parent78d8f90ffae45808096133c461ef1ee0e65de937 (diff)
downloadandroid_external_e2fsprogs-7b4e4534f9361b21d3fafdd88a58f133decee38c.tar.gz
android_external_e2fsprogs-7b4e4534f9361b21d3fafdd88a58f133decee38c.tar.bz2
android_external_e2fsprogs-7b4e4534f9361b21d3fafdd88a58f133decee38c.zip
Many files:
Added definition of ext2fs_get_mem, ext2fs_free_mem, and ext2fs_resize_mem in ext2fs.h, and changed all library routines to use these wrapper functions.
Diffstat (limited to 'lib/ext2fs/dir_iterate.c')
-rw-r--r--lib/ext2fs/dir_iterate.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ext2fs/dir_iterate.c b/lib/ext2fs/dir_iterate.c
index 8d8de575..0784ef20 100644
--- a/lib/ext2fs/dir_iterate.c
+++ b/lib/ext2fs/dir_iterate.c
@@ -48,9 +48,9 @@ errcode_t ext2fs_dir_iterate(ext2_filsys fs,
if (block_buf)
ctx.buf = block_buf;
else {
- ctx.buf = malloc(fs->blocksize);
- if (!ctx.buf)
- return EXT2_NO_MEMORY;
+ retval = ext2fs_get_mem(fs->blocksize, (void **) &ctx.buf);
+ if (retval)
+ return retval;
}
ctx.func = func;
ctx.func2 = 0;
@@ -59,7 +59,7 @@ errcode_t ext2fs_dir_iterate(ext2_filsys fs,
retval = ext2fs_block_iterate(fs, dir, 0, 0,
ext2fs_process_dir_block, &ctx);
if (!block_buf)
- free(ctx.buf);
+ ext2fs_free_mem((void **) &ctx.buf);
if (retval)
return retval;
return ctx.errcode;