diff options
author | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-06-08 11:55:34 +0000 |
---|---|---|
committer | Michal Rokos <m.rokos@sh.cvut.cz> | 2002-06-08 11:55:34 +0000 |
commit | e89a316664cceda7fd3e105f876c159042625ef5 (patch) | |
tree | 85274363eb4abf1a5f8a5c4814fa297097ea4d54 /ossl_x509store.c | |
parent | 8490cea1dae17c43a809482876bc13988d56c7be (diff) | |
download | ruby-openssl-history-e89a316664cceda7fd3e105f876c159042625ef5.tar.gz |
X509Cert: introduced GetX509CertPtr and DupX509CertPtr
X509Ext: fixed memory leaking in ExtFactory after GC
Diffstat (limited to 'ossl_x509store.c')
-rw-r--r-- | ossl_x509store.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/ossl_x509store.c b/ossl_x509store.c index e0714b7..19b9ee2 100644 --- a/ossl_x509store.c +++ b/ossl_x509store.c @@ -200,15 +200,11 @@ ossl_x509store_add_trusted(VALUE self, VALUE cert) GetX509Store(self, storep); - OSSL_Check_Type(cert, cX509Cert); - x509 = ossl_x509_get_X509(cert); + x509 = DupX509CertPtr(cert); /* DUP NEEDED!!! */ if (!X509_STORE_add_cert(storep->store->ctx, x509)) { - X509_free(x509); OSSL_Raise(eX509StoreError, ""); } - X509_free(x509); - return cert; } @@ -318,14 +314,11 @@ static VALUE ossl_x509store_verify(VALUE self, VALUE cert) { ossl_x509store *storep = NULL; - X509 *x509 = NULL; int result = 0; GetX509Store(self, storep); - OSSL_Check_Type(cert, cX509Cert); - x509 = ossl_x509_get_X509(cert); - X509_STORE_CTX_set_cert(storep->store, x509); + X509_STORE_CTX_set_cert(storep->store, GetX509CertPtr(cert)); /* NO DUP NEEDED. */ result = X509_verify_cert(storep->store); /*X509_STORE_CTX_cleanup(storep->store); *clears chain*/ |