diff options
author | Kazuki Yamaguchi <k@rhe.jp> | 2016-08-07 00:41:06 +0900 |
---|---|---|
committer | Kazuki Yamaguchi <k@rhe.jp> | 2016-08-14 21:24:52 +0900 |
commit | 7af0ae6bd01084a40f3bd42cec1a96557bae3cfa (patch) | |
tree | 1996a345fccb94473cb7109b892143416557b868 /ext/openssl/ossl_x509ext.c | |
parent | 03ef996e342678fe4fff7484929f6dbb4021305d (diff) | |
download | ruby-openssl-7af0ae6bd01084a40f3bd42cec1a96557bae3cfa.tar.gz |
x509ext: fix a memory leak in X509::ExtensionFactory#create_ext
The CONF returned by DupConfigPtr() must be free'd by the caller.
Diffstat (limited to 'ext/openssl/ossl_x509ext.c')
-rw-r--r-- | ext/openssl/ossl_x509ext.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/openssl/ossl_x509ext.c b/ext/openssl/ossl_x509ext.c index b4098859..12f94c6d 100644 --- a/ext/openssl/ossl_x509ext.c +++ b/ext/openssl/ossl_x509ext.c @@ -259,6 +259,7 @@ ossl_x509extfactory_create_ext(int argc, VALUE *argv, VALUE self) rconf = rb_iv_get(self, "@config"); conf = NIL_P(rconf) ? NULL : DupConfigPtr(rconf); ext = X509V3_EXT_nconf_nid(conf, ctx, nid, RSTRING_PTR(valstr)); + NCONF_free(conf); if (!ext){ ossl_raise(eX509ExtError, "%"PRIsVALUE" = %"PRIsVALUE, oid, valstr); } |