From: Harshad Shirwadkar Date: Thu, 4 Feb 2021 23:35:59 +0000 (-0800) Subject: ext2fs: initialize handle to NULL in ext2fs_count_blks X-Git-Tag: v1.46.1~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fae964a0e3d68498a5accfd2fd0780352415660;p=thirdparty%2Fe2fsprogs.git ext2fs: initialize handle to NULL in ext2fs_count_blks Initialize the handle to NULL to ensure that in error cases, ext2fs_free_mem can be called on it. Signed-off-by: Harshad Shirwadkar Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/extent.c b/lib/ext2fs/extent.c index bde6b0f35..1a87e68b9 100644 --- a/lib/ext2fs/extent.c +++ b/lib/ext2fs/extent.c @@ -1809,7 +1809,7 @@ errcode_t ext2fs_decode_extent(struct ext2fs_extent *to, void *addr, int len) errcode_t ext2fs_count_blocks(ext2_filsys fs, ext2_ino_t ino, struct ext2_inode *inode, blk64_t *ret_count) { - ext2_extent_handle_t handle; + ext2_extent_handle_t handle = NULL; struct ext2fs_extent extent; errcode_t errcode; int i;