From: Wang Shilong <wshilong@xxxxxxx> Two memory allocation return check is missed. Signed-off-by: Wang Shilong <wshilong@xxxxxxx> --- e2fsck/rehash.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c index a5fc1be1..5250652e 100644 --- a/e2fsck/rehash.c +++ b/e2fsck/rehash.c @@ -272,7 +272,11 @@ static errcode_t alloc_size_dir(ext2_filsys fs, struct out_dir *outdir, outdir->hashes = new_mem; } else { outdir->buf = malloc(blocks * fs->blocksize); + if (!outdir->buf) + return ENOMEM; outdir->hashes = malloc(blocks * sizeof(ext2_dirhash_t)); + if (!outdir->hashes) + return ENOMEM; outdir->num = 0; } outdir->max = blocks; -- 2.21.0