Bug 1494675 - Fix remaining static-analysis warnings in dom/media/webrtc. r=jib

Bug 1538113 fixed most, but apparently some remained. Unclear why -- perhaps I
ran it with a different config this time.

Differential Revision: https://phabricator.services.mozilla.com/D24903

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2019-03-27 18:58:45 +00:00
Родитель 4b06f8478d
Коммит 8a27a07a02
1 изменённых файлов: 4 добавлений и 5 удалений

Просмотреть файл

@ -89,7 +89,7 @@ class GenerateRTCCertificateTask : public GenerateAsymmetricKeyTask {
return NS_ERROR_DOM_UNKNOWN_ERR;
}
UniqueSECKEYPublicKey publicKey(mKeyPair->mPublicKey.get()->GetPublicKey());
UniqueSECKEYPublicKey publicKey(mKeyPair->mPublicKey->GetPublicKey());
UniqueCERTSubjectPublicKeyInfo spki(
SECKEY_CreateSubjectPublicKeyInfo(publicKey.get()));
if (!spki) {
@ -154,8 +154,7 @@ class GenerateRTCCertificateTask : public GenerateAsymmetricKeyTask {
return NS_ERROR_DOM_UNKNOWN_ERR;
}
UniqueSECKEYPrivateKey privateKey(
mKeyPair->mPrivateKey.get()->GetPrivateKey());
UniqueSECKEYPrivateKey privateKey(mKeyPair->mPrivateKey->GetPrivateKey());
rv = SEC_DerSignData(arena, signedCert, innerDER.data, innerDER.len,
privateKey.get(), mSignatureAlg);
if (rv != SECSuccess) {
@ -173,7 +172,7 @@ class GenerateRTCCertificateTask : public GenerateAsymmetricKeyTask {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
KeyAlgorithmProxy& alg = mKeyPair->mPublicKey.get()->Algorithm();
KeyAlgorithmProxy& alg = mKeyPair->mPublicKey->Algorithm();
if (alg.mType != KeyAlgorithmProxy::RSA ||
!alg.mRsa.mHash.mName.EqualsLiteral(WEBCRYPTO_ALG_SHA256)) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
@ -210,7 +209,7 @@ class GenerateRTCCertificateTask : public GenerateAsymmetricKeyTask {
virtual void Resolve() override {
// Make copies of the private key and certificate, otherwise, when this
// object is deleted, the structures they reference will be deleted too.
UniqueSECKEYPrivateKey key = mKeyPair->mPrivateKey.get()->GetPrivateKey();
UniqueSECKEYPrivateKey key = mKeyPair->mPrivateKey->GetPrivateKey();
CERTCertificate* cert = CERT_DupCertificate(mCertificate.get());
RefPtr<RTCCertificate> result =
new RTCCertificate(mResultPromise->GetParentObject(), key.release(),