summaryrefslogtreecommitdiff
path: root/lib/ext2fs/dblist.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ext2fs/dblist.c')
-rw-r--r--lib/ext2fs/dblist.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/ext2fs/dblist.c b/lib/ext2fs/dblist.c
index ca1446b9..3f6ea50d 100644
--- a/lib/ext2fs/dblist.c
+++ b/lib/ext2fs/dblist.c
@@ -61,7 +61,7 @@ static errcode_t make_dblist(ext2_filsys fs, ext2_ino_t size,
struct ext2_db_entry2 *list,
ext2_dblist *ret_dblist)
{
- ext2_dblist dblist;
+ ext2_dblist dblist = NULL;
errcode_t retval;
ext2_ino_t num_dirs;
size_t len;
@@ -393,10 +393,11 @@ int ext2fs_dblist_count(ext2_dblist dblist)
errcode_t ext2fs_dblist_get_last(ext2_dblist dblist,
struct ext2_db_entry **entry)
{
- EXT2_CHECK_MAGIC(dblist, EXT2_ET_MAGIC_DBLIST);
static struct ext2_db_entry ret_entry;
struct ext2_db_entry2 *last;
+ EXT2_CHECK_MAGIC(dblist, EXT2_ET_MAGIC_DBLIST);
+
if (dblist->count == 0)
return EXT2_ET_DBLIST_EMPTY;