Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(chore) free memory using asn1_time_free when asn1_time_set is used #11

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/resty/openssl/include/asn1.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ declare_asn1_functions("ASN1_INTEGER")
declare_asn1_functions("ASN1_OBJECT")
declare_asn1_functions("ASN1_STRING")
declare_asn1_functions("ASN1_ENUMERATED")
declare_asn1_functions("ASN1_TIME")

local OPENSSL_10 = require("resty.openssl.version").OPENSSL_10
local OPENSSL_11_OR_LATER = require("resty.openssl.version").OPENSSL_11_OR_LATER
Expand Down
2 changes: 1 addition & 1 deletion lib/resty/openssl/x509/revoked.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function _M.new(sn, time, reason)
if time == nil then
return nil, format_error("x509.revoked.new: ASN1_TIME_set()")
end
ffi_gc(time, C.ASN1_STRING_free)
ffi_gc(time, C.ASN1_TIME_free)

if C.X509_REVOKED_set_revocationDate(ctx, time) == 0 then
return nil, format_error("x509.revoked.new: X509_REVOKED_set_revocationDate()")
Expand Down