Bug 1591363 - Fixup double-free of params in nsc_SetupPBEKeyGen r=keeler
authorJ.C. Jones <jjones@mozilla.com>
Wed, 13 Nov 2019 18:52:22 +0000
changeset 15387 87f35ba4c82f17204c6714f10559a37896f0314f
parent 15386 d244c72879080747cfa4275f04a02969ce0be932
child 15396 e8f2720c8254a5327260dec70153a3c3b7c745b9
push id3580
push userjjones@mozilla.com
push dateWed, 13 Nov 2019 18:59:21 +0000
reviewerskeeler
bugs1591363
Bug 1591363 - Fixup double-free of params in nsc_SetupPBEKeyGen r=keeler Caused in commit 7ef8d2604494. Differential Revision: https://phabricator.services.mozilla.com/D52848
lib/softoken/pkcs11c.c
--- a/lib/softoken/pkcs11c.c
+++ b/lib/softoken/pkcs11c.c
@@ -4393,17 +4393,16 @@ nsc_SetupPBEKeyGen(CK_MECHANISM_PTR pMec
             if (*key_length == 0) {
                 crv = CKR_TEMPLATE_INCOMPLETE;
                 break;
             }
             params->keyLen = *key_length;
             break;
         default:
             crv = CKR_MECHANISM_INVALID;
-            nsspkcs5_DestroyPBEParameter(params);
             break;
     }
     if (crv == CKR_OK) {
         *pbe = params;
     } else {
         nsspkcs5_DestroyPBEParameter(params);
     }
     return crv;