diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-29 05:55:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-05-29 05:55:02 +0000 |
commit | 0b8ad915b8c0fef1833716784dd94a0ef6caec92 (patch) | |
tree | ed014c958a0f622db02af64186def2c70e4c00ba /ext/openssl/ossl_pkey.c | |
parent | dfe11b5df4c8c37f07685da46eea7670dcb562be (diff) | |
download | ruby-0b8ad915b8c0fef1833716784dd94a0ef6caec92.tar.gz |
openssl: wrapper object before alloc
* ext/openssl: make wrapper objects before allocating structs to
get rid of potential memory leaks.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/openssl/ossl_pkey.c')
-rw-r--r-- | ext/openssl/ossl_pkey.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/openssl/ossl_pkey.c b/ext/openssl/ossl_pkey.c index 21a977c245..01dab285c6 100644 --- a/ext/openssl/ossl_pkey.c +++ b/ext/openssl/ossl_pkey.c @@ -241,10 +241,11 @@ ossl_pkey_alloc(VALUE klass) EVP_PKEY *pkey; VALUE obj; + obj = NewPKey(klass); if (!(pkey = EVP_PKEY_new())) { ossl_raise(ePKeyError, NULL); } - WrapPKey(klass, obj, pkey); + SetPKey(obj, pkey); return obj; } |