diff options
Diffstat (limited to 'lib/ext2fs/block.c')
-rw-r--r-- | lib/ext2fs/block.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/ext2fs/block.c b/lib/ext2fs/block.c index f938380c..29460036 100644 --- a/lib/ext2fs/block.c +++ b/lib/ext2fs/block.c @@ -332,9 +332,10 @@ errcode_t ext2fs_block_iterate2(ext2_filsys fs, if (block_buf) { ctx.ind_buf = block_buf; } else { - ctx.ind_buf = malloc(fs->blocksize * 3); - if (!ctx.ind_buf) - return EXT2_NO_MEMORY; + retval = ext2fs_get_mem(fs->blocksize * 3, + (void **) &ctx.ind_buf); + if (retval) + return retval; } ctx.dind_buf = ctx.ind_buf + fs->blocksize; ctx.tind_buf = ctx.dind_buf + fs->blocksize; @@ -403,7 +404,7 @@ abort: } if (!block_buf) - free(ctx.ind_buf); + ext2fs_free_mem((void **) &ctx.ind_buf); return (ret & BLOCK_ERROR) ? ctx.errcode : 0; } |