mdb_page_malloc(): Move VGMEMP_ALLOC before memset
authorHallvard Furuseth <hallvard@openldap.org>
Tue, 31 Dec 2013 01:16:19 +0000 (02:16 +0100)
committerHallvard Furuseth <hallvard@openldap.org>
Tue, 31 Dec 2013 01:16:19 +0000 (02:16 +0100)
libraries/liblmdb/mdb.c

index a6d7791a5a3d695ce33ee5d220f000fe21512ede..e6ac29930dbed05183cac0921e2e429678eac681 100644 (file)
@@ -1389,11 +1389,11 @@ mdb_page_malloc(MDB_txn *txn, unsigned num)
                off = sz - psize;
        }
        if ((ret = malloc(sz)) != NULL) {
+               VGMEMP_ALLOC(env, ret, sz);
                if (!(env->me_flags & MDB_NOMEMINIT)) {
                        memset((char *)ret + off, 0, psize);
                        ret->mp_pad = 0;
                }
-               VGMEMP_ALLOC(env, ret, sz);
        }
        return ret;
 }