Bug 1465241 - always init tmpArena, r=mt
authorFranziskus Kiefer <franziskuskiefer@gmail.com>
Tue, 05 Jun 2018 10:59:44 +0200
changeset 14396 798e88281cef81baeb6a445aa8288b2fc752a30e
parent 14395 e36e5500f6534ea7e5b48b29215ab4d844ce7e70
child 14397 9391fc982e713f66db0007f86f24abb74d9b51d3
push id3120
push userfranziskuskiefer@gmail.com
push dateWed, 06 Jun 2018 08:24:53 +0000
reviewersmt
bugs1465241
Bug 1465241 - always init tmpArena, r=mt Differential Revision: https://phabricator.services.mozilla.com/D1552
lib/softoken/legacydb/pcertdb.c
--- a/lib/softoken/legacydb/pcertdb.c
+++ b/lib/softoken/legacydb/pcertdb.c
@@ -2572,24 +2572,23 @@ ReadDBSubjectEntry(NSSLOWCERTCertDBHandl
     PLArenaPool *arena = NULL;
     PORTCheapArenaPool tmpArena;
 
     certDBEntrySubject *entry;
     SECItem dbkey;
     SECItem dbentry;
     SECStatus rv;
 
+    PORT_InitCheapArena(&tmpArena, DER_DEFAULT_CHUNKSIZE);
     arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
     if (arena == NULL) {
         PORT_SetError(SEC_ERROR_NO_MEMORY);
         goto loser;
     }
 
-    PORT_InitCheapArena(&tmpArena, DER_DEFAULT_CHUNKSIZE);
-
     entry = (certDBEntrySubject *)PORT_ArenaAlloc(arena,
                                                   sizeof(certDBEntrySubject));
     if (entry == NULL) {
         PORT_SetError(SEC_ERROR_NO_MEMORY);
         goto loser;
     }
     entry->common.arena = arena;
     entry->common.type = certDBEntryTypeSubject;