ITS#7377 mdb_env_init_meta(): Catch calloc error

mdb.RE/0.9
Hallvard Furuseth 9 years ago committed by Howard Chu
parent 9a8d38a9de
commit 7f151b1137
  1. 3
      libraries/liblmdb/mdb.c

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

Loading…
Cancel
Save