summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEKR <ekr@rtfm.com>2015-08-27 10:44:26 -0700
committerEKR <ekr@rtfm.com>2015-08-27 10:44:26 -0700
commite956b046a2fb5ff0c0a393b5bd8598bcba27d0c8 (patch)
tree7a8afca2405c91dce98f4297663bb1c7911cb048
parent947918cc59655237d6e6ada0ba849dafe281eb15 (diff)
downloadnss-hg-e956b046a2fb5ff0c0a393b5bd8598bcba27d0c8.tar.gz
Bug 1199349. Fix slot leak in ssl3_HandleRSAClientKeyExchange. r=mt
-rw-r--r--lib/ssl/ssl3con.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ssl/ssl3con.c b/lib/ssl/ssl3con.c
index 877f1fcb0..ee08faec6 100644
--- a/lib/ssl/ssl3con.c
+++ b/lib/ssl/ssl3con.c
@@ -9781,7 +9781,13 @@ double_bypass:
/* Generate the bogus PMS (R) */
slot = PK11_GetSlotFromPrivateKey(serverKey);
+ if (!slot) {
+ PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);
+ return SECFailure;
+ }
+
if (!PK11_DoesMechanism(slot, CKM_SSL3_MASTER_KEY_DERIVE)) {
+ PK11_FreeSlot(slot);
slot = PK11_GetBestSlot(CKM_SSL3_MASTER_KEY_DERIVE, NULL);
if (!slot) {
PORT_SetError(SEC_ERROR_LIBRARY_FAILURE);