ITS#7377 mdb_env_init_meta(): Catch calloc error

This commit is contained in:
Hallvard Furuseth 2015-08-23 11:12:45 +02:00 committed by Howard Chu
parent 9a8d38a9de
commit 7f151b1137

View File

@ -3553,6 +3553,9 @@ mdb_env_init_meta(MDB_env *env, MDB_meta *meta)
mdb_env_init_meta0(env, meta);
p = calloc(2, psize);
if (!p)
return ENOMEM;
p->mp_pgno = 0;
p->mp_flags = P_META;
*(MDB_meta *)METADATA(p) = *meta;