aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ext2fs/expanddir.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/expanddir.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/expanddir.c')
-rw-r--r--lib/ext2fs/expanddir.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/ext2fs/expanddir.c b/lib/ext2fs/expanddir.c
index 46ada204..1da5143b 100644
--- a/lib/ext2fs/expanddir.c
+++ b/lib/ext2fs/expanddir.c
@@ -54,9 +54,9 @@ static int expand_dir_proc(ext2_filsys fs,
}
es->done = 1;
} else {
- block = malloc(fs->blocksize);
- if (!block) {
- es->err = EXT2_NO_MEMORY;
+ retval = ext2fs_get_mem(fs->blocksize, (void **) &block);
+ if (retval) {
+ es->err = retval;
return BLOCK_ABORT;
}
memset(block, 0, fs->blocksize);
@@ -66,7 +66,7 @@ static int expand_dir_proc(ext2_filsys fs,
es->err = retval;
return BLOCK_ABORT;
}
- free(block);
+ ext2fs_free_mem((void **) &block);
*blocknr = new_blk;
ext2fs_mark_block_bitmap(fs->block_map, new_blk);
ext2fs_mark_bb_dirty(fs);