mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-28 18:17:29 +09:00
Don't leak newTemplate in pk11_copyAttributes()
Cherry-pick of NSS fix from 3.37
This commit is contained in:
parent
749d1d4ae4
commit
1ed60ee41b
1 changed files with 3 additions and 2 deletions
|
|
@ -74,7 +74,7 @@ pk11_copyAttributes(PLArenaPool *arena,
|
||||||
return SECFailure;
|
return SECFailure;
|
||||||
}
|
}
|
||||||
/* remove the unknown attributes. If we don't have enough attributes
|
/* 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++) {
|
for (i = 0, j = 0; i < copyTemplateCount; i++) {
|
||||||
if (copyTemplate[i].ulValueLen != -1) {
|
if (copyTemplate[i].ulValueLen != -1) {
|
||||||
newTemplate[j] = copyTemplate[i];
|
newTemplate[j] = copyTemplate[i];
|
||||||
|
|
@ -88,6 +88,7 @@ pk11_copyAttributes(PLArenaPool *arena,
|
||||||
}
|
}
|
||||||
if (crv != CKR_OK) {
|
if (crv != CKR_OK) {
|
||||||
PORT_SetError(PK11_MapError(crv));
|
PORT_SetError(PK11_MapError(crv));
|
||||||
|
PORT_Free(newTemplate);
|
||||||
return SECFailure;
|
return SECFailure;
|
||||||
}
|
}
|
||||||
if (targetID == CK_INVALID_HANDLE) {
|
if (targetID == CK_INVALID_HANDLE) {
|
||||||
|
|
@ -100,7 +101,7 @@ pk11_copyAttributes(PLArenaPool *arena,
|
||||||
copyTemplate, copyTemplateCount);
|
copyTemplate, copyTemplateCount);
|
||||||
}
|
}
|
||||||
if (newTemplate) {
|
if (newTemplate) {
|
||||||
free(newTemplate);
|
PORT_Free(newTemplate);
|
||||||
}
|
}
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue