deps: call OPENSSL_free after ANS1_STRING_to_UTF8

Co-Authored-By: Chris Smith <chrismith@vista.com>
Signed-off-by: RafaelGSS <rafael.nunu@hotmail.com>
PR-URL: https://github.com/nodejs/node/pull/60609
Refs: https://github.com/nodejs/node/issues/58380
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
This commit is contained in:
Rafael GonzagaandChris Smith authored and GitHub committed 2025-11-10 14:21:49 +00:00
1 parent 408aba6190
commit 5e1ab9fffb
1 file changed
+4 -3
+4 -3
View File
@@ -4666,9 +4666,10 @@ std::pair<std::string, std::string> X509Name::Iterator::operator*() const {
unsigned char* value_str;
int value_str_size = ASN1_STRING_to_UTF8(&value_str, value);
return {
std::move(name_str),
std::string(reinterpret_cast<const char*>(value_str), value_str_size)};
std::string out(reinterpret_cast<const char*>(value_str), value_str_size);
OPENSSL_free(value_str); // free after copy
return {std::move(name_str), std::move(out)};
}
// ============================================================================