mirror of
https://github.com/nodejs/node.git
synced 2026-11-15 10:36:53 -05:00
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:
1 parent
408aba6190
commit
5e1ab9fffb
1 file changed
+4
-3
Vendored
+4
-3
@@ -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)};
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
|
||||
Reference in new issue
Block a user