Skip to content

Commit 7f151b1

Browse files
hfuruhyc
authored andcommitted
ITS#7377 mdb_env_init_meta(): Catch calloc error
1 parent 9a8d38a commit 7f151b1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libraries/liblmdb/mdb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3553,6 +3553,9 @@ mdb_env_init_meta(MDB_env *env, MDB_meta *meta)
35533553
mdb_env_init_meta0(env, meta);
35543554

35553555
p = calloc(2, psize);
3556+
if (!p)
3557+
return ENOMEM;
3558+
35563559
p->mp_pgno = 0;
35573560
p->mp_flags = P_META;
35583561
*(MDB_meta *)METADATA(p) = *meta;

0 commit comments

Comments
 (0)