зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1049434 - Don't allocate SECItems with new operator r=rbarnes
This commit is contained in:
Родитель
64200120e3
Коммит
400f767c33
|
@ -5,6 +5,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "CryptoBuffer.h"
|
||||
#include "secitem.h"
|
||||
#include "mozilla/Base64.h"
|
||||
#include "mozilla/dom/UnionTypes.h"
|
||||
|
||||
|
@ -150,7 +151,7 @@ CryptoBuffer::ToSECItem() const
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
SECItem* item = new SECItem();
|
||||
SECItem* item = ::SECITEM_AllocItem(nullptr, nullptr, 0);
|
||||
item->type = siBuffer;
|
||||
item->data = data;
|
||||
item->len = Length();
|
||||
|
|
|
@ -560,7 +560,11 @@ bool ReadAndEncodeAttribute(SECKEYPrivateKey* aKey,
|
|||
CK_ATTRIBUTE_TYPE aAttribute,
|
||||
Optional<nsString>& aDst)
|
||||
{
|
||||
ScopedSECItem item(new SECItem());
|
||||
ScopedSECItem item(::SECITEM_AllocItem(nullptr, nullptr, 0));
|
||||
if (!item) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (PK11_ReadRawAttribute(PK11_TypePrivKey, aKey, aAttribute, item)
|
||||
!= SECSuccess) {
|
||||
return false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче