projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
07fbb43
)
crypto: fix memory leak in LoadPKCS12
author
Fedor Indutny
<fedor.indutny@gmail.com>
Thu, 27 Jun 2013 17:53:29 +0000
(19:53 +0200)
committer
Fedor Indutny
<fedor.indutny@gmail.com>
Wed, 3 Jul 2013 12:16:44 +0000
(16:16 +0400)
X509_STORE_add_cert increment reference of passed `x509` cert,
`X509_free` must be called to avoid memory leak.
src/node_crypto.cc
patch
|
blob
|
history
diff --git
a/src/node_crypto.cc
b/src/node_crypto.cc
index
fffe6b6
..
c902bcb
100644
(file)
--- a/
src/node_crypto.cc
+++ b/
src/node_crypto.cc
@@
-730,6
+730,7
@@
Handle<Value> SecureContext::LoadPKCS12(const Arguments& args) {
X509_STORE_add_cert(sc->ca_store_, x509);
SSL_CTX_add_client_CA(sc->ctx_, x509);
+ X509_free(x509);
}
EVP_PKEY_free(pkey);