Skip to content

Commit

Permalink
crypto: fix memory leak in PublicKeyCipher::Cipher
Browse files Browse the repository at this point in the history
PR-URL: #2375
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
  • Loading branch information
skomski authored and Fishrock123 committed Aug 19, 2015
1 parent a760a87 commit 6a16368
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3931,6 +3931,8 @@ bool PublicKeyCipher::Cipher(const char* key_pem,
fatal = false;

exit:
if (x509 != nullptr)
X509_free(x509);
if (pkey != nullptr)
EVP_PKEY_free(pkey);
if (bp != nullptr)
Expand Down

0 comments on commit 6a16368

Please sign in to comment.