From 7f151b113738e0f94d6477c8028f3318fc34a2d9 Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Sun, 23 Aug 2015 11:12:45 +0200 Subject: [PATCH] ITS#7377 mdb_env_init_meta(): Catch calloc error --- libraries/liblmdb/mdb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index b5d59bc..087f198 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -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;