diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-07-01 16:31:31 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-07-01 16:31:31 +0200 |
commit | aa6329b694a981dccd5b0fd124936c4b54fb94a4 (patch) | |
tree | 49eee21ad78c09f9575d938bb824c605dab5e6f7 /security | |
parent | 46450ce7de0aa5e27a2dfb49afe66b0de6130556 (diff) | |
download | uxp-aa6329b694a981dccd5b0fd124936c4b54fb94a4.tar.gz |
Don't leak newTemplate in pk11_copyAttributes()
Cherry-pick of NSS fix from 3.37
Diffstat (limited to 'security')
-rw-r--r-- | security/nss/lib/pk11wrap/pk11merge.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/security/nss/lib/pk11wrap/pk11merge.c b/security/nss/lib/pk11wrap/pk11merge.c index b2101b8191..c6125b6e63 100644 --- a/security/nss/lib/pk11wrap/pk11merge.c +++ b/security/nss/lib/pk11wrap/pk11merge.c @@ -74,7 +74,7 @@ pk11_copyAttributes(PLArenaPool *arena, return SECFailure; } /* remove the unknown attributes. If we don't have enough attributes - * PK11_CreateNewObject() will fail */ + * PK11_CreateNewObject() will fail */ for (i = 0, j = 0; i < copyTemplateCount; i++) { if (copyTemplate[i].ulValueLen != -1) { newTemplate[j] = copyTemplate[i]; @@ -88,6 +88,7 @@ pk11_copyAttributes(PLArenaPool *arena, } if (crv != CKR_OK) { PORT_SetError(PK11_MapError(crv)); + PORT_Free(newTemplate); return SECFailure; } if (targetID == CK_INVALID_HANDLE) { @@ -100,7 +101,7 @@ pk11_copyAttributes(PLArenaPool *arena, copyTemplate, copyTemplateCount); } if (newTemplate) { - free(newTemplate); + PORT_Free(newTemplate); } return rv; } |