summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranziskus Kiefer <franziskuskiefer@gmail.com>2016-05-26 10:57:49 +0200
committerFranziskus Kiefer <franziskuskiefer@gmail.com>2016-05-26 10:57:49 +0200
commitc98a55ff1afaaf2ac7b5c93eccb18b926a21f7dd (patch)
tree35b661670ccc546c246da365ae7c226627866491
parentc9e84e981fae61eb8f3bafe52ac61b5318001d1f (diff)
downloadnss-hg-c98a55ff1afaaf2ac7b5c93eccb18b926a21f7dd.tar.gz
Bug 1272752 - checking for out of memory, r=mt
-rw-r--r--lib/softoken/legacydb/pcertdb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/softoken/legacydb/pcertdb.c b/lib/softoken/legacydb/pcertdb.c
index ac2965f95..4e6a5cf9c 100644
--- a/lib/softoken/legacydb/pcertdb.c
+++ b/lib/softoken/legacydb/pcertdb.c
@@ -4352,6 +4352,10 @@ certcallback(SECItem *dbdata, SECItem *dbkey, certDBEntryType type, void *data)
}
entry = (certDBEntryCert *)PORT_ArenaAlloc(arena, sizeof(certDBEntryCert));
+ if (!entry) {
+ PORT_SetError(SEC_ERROR_NO_MEMORY);
+ goto loser;
+ }
mystate = (PermCertCallbackState *)data;
entry->common.version = (unsigned int)dbdata->data[0];
entry->common.type = (certDBEntryType)dbdata->data[1];