From 066ca7fb6ac29113accea92fbab3309be31aa64c Mon Sep 17 00:00:00 2001 From: Mayo Date: Tue, 19 Apr 2022 15:43:49 +0800 Subject: [PATCH] fix(ldap-auth) free internal pointer after covert to lua string --- kong/plugins/ldap-auth/asn1.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kong/plugins/ldap-auth/asn1.lua b/kong/plugins/ldap-auth/asn1.lua index 74bd6dcf7fcf..05c8ecdb2d8a 100644 --- a/kong/plugins/ldap-auth/asn1.lua +++ b/kong/plugins/ldap-auth/asn1.lua @@ -213,9 +213,9 @@ do if typ == nil then return nil end - local ret = ASN1_STRING_get0_data(typ) + local ret = ffi_string(ASN1_STRING_get0_data(typ)) C.ASN1_STRING_free(typ) - return ffi_string(ret) + return ret end decoder[TAG.INTEGER] = function(der, offset, len)