From e9e3c9fb514a9eaf6f8436e1683dca78c12b15de 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/liblmdb/mdb.c b/libraries/liblmdb/mdb.c index 08aa9914ac..5fc4fbcce6 100644 --- a/libraries/liblmdb/mdb.c +++ b/libraries/liblmdb/mdb.c @@ -3695,6 +3695,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 *)METADATA(p) = *meta; -- 2.39.5