From 7af0ae6bd01084a40f3bd42cec1a96557bae3cfa Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Sun, 7 Aug 2016 00:41:06 +0900 Subject: x509ext: fix a memory leak in X509::ExtensionFactory#create_ext The CONF returned by DupConfigPtr() must be free'd by the caller. --- ext/openssl/ossl_x509ext.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ext/openssl/ossl_x509ext.c') 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); } -- cgit v1.2.3