summaryrefslogtreecommitdiff
path: root/ext/openssl/ossl_ns_spki.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/openssl/ossl_ns_spki.c')
-rw-r--r--ext/openssl/ossl_ns_spki.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/openssl/ossl_ns_spki.c b/ext/openssl/ossl_ns_spki.c
index 3932f3e9710..9aed773edca 100644
--- a/ext/openssl/ossl_ns_spki.c
+++ b/ext/openssl/ossl_ns_spki.c
@@ -80,8 +80,7 @@ ossl_spki_to_pem(VALUE self)
if (!(data = NETSCAPE_SPKI_b64_encode(spki))) {
ossl_raise(eSPKIError, NULL);
}
- str = rb_str_new2(data);
- OPENSSL_free(data);
+ str = ossl_buf2str(data, strlen(data));
return str;
}