Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1761)

Unified Diff: content/renderer/webcrypto/platform_crypto_nss.cc

Issue 184753002: Fix memory leak from use of SECKEY_ConvertToPublicKey(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add suppression file Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/webcrypto/platform_crypto_nss.cc
diff --git a/content/renderer/webcrypto/platform_crypto_nss.cc b/content/renderer/webcrypto/platform_crypto_nss.cc
index 67e2e8bbddefd1e30df62b1f770a810812f71422..eca13a8e0c7e35170c293e4cf81a04bf85756c4d 100644
--- a/content/renderer/webcrypto/platform_crypto_nss.cc
+++ b/content/renderer/webcrypto/platform_crypto_nss.cc
@@ -441,8 +441,8 @@ bool CreatePublicKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm,
bool CreatePrivateKeyAlgorithm(const blink::WebCryptoAlgorithm& algorithm,
SECKEYPrivateKey* key,
blink::WebCryptoKeyAlgorithm* key_algorithm) {
- return CreatePublicKeyAlgorithm(
- algorithm, SECKEY_ConvertToPublicKey(key), key_algorithm);
+ crypto::ScopedSECKEYPublicKey public_key(SECKEY_ConvertToPublicKey(key));
+ return CreatePublicKeyAlgorithm(algorithm, public_key.get(), key_algorithm);
}
} // namespace
« no previous file with comments | « no previous file | tools/valgrind/memcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698