lmdb: ITS#7377 catch calloc error in mdb_env_init_meta().

Change-Id: I2b1a4ec9f86a3a7844b157863d18ce81be400cef
This commit is contained in:
Hallvard Furuseth 2015-08-23 11:12:45 +02:00 committed by Leo Yuriev
parent 73941be79a
commit e4d9f0a905

2
mdb.c
View File

@ -3978,6 +3978,8 @@ mdb_env_init_meta(MDB_env *env, MDB_meta *meta)
psize = env->me_psize;
p = calloc(NUM_METAS, psize);
if (!p)
return ENOMEM;
p->mp_pgno = 0;
p->mp_flags = P_META;
*(MDB_meta *)PAGEDATA(p) = *meta;