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 <[email protected]>
  • Loading branch information
skomski authored and bnoordhuis committed Aug 17, 2015
1 parent dbecb21 commit 4b61cb0
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 @@ -3933,6 +3933,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 4b61cb0

Please sign in to comment.