From a8f4eefb65b514b104674d2405e19b0c1cdf8deb Mon Sep 17 00:00:00 2001 From: "alexei.volkov.bugs%sun.com" Date: Mon, 9 Oct 2006 22:28:07 +0000 Subject: [PATCH] 353903: klocwork oom crash in softoken/keydb.c. r=nelson --- security/nss/lib/softoken/keydb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/security/nss/lib/softoken/keydb.c b/security/nss/lib/softoken/keydb.c index d52161edbd34..1a84d5486766 100644 --- a/security/nss/lib/softoken/keydb.c +++ b/security/nss/lib/softoken/keydb.c @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -/* $Id: keydb.c,v 1.48 2006/08/25 23:04:15 alexei.volkov.bugs%sun.com Exp $ */ +/* $Id: keydb.c,v 1.49 2006/10/09 22:28:07 alexei.volkov.bugs%sun.com Exp $ */ #include "lowkeyi.h" #include "seccomon.h" @@ -1082,6 +1082,10 @@ nsslowkey_OpenKeyDB(PRBool readOnly, const char *appName, const char *prefix, handle = nsslowkey_NewHandle(NULL); + if (!handle) { + /* error code is set */ + return NULL; + } openflags = readOnly ? NO_RDONLY : NO_RDWR;