Skip to content

Commit 91cd64a

Browse files
committed
Fix memory leak
IB-8942 Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent 426562d commit 91cd64a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/crypto/X509Crypto.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ int X509Crypto::compareIssuerToString(string_view name) const
135135

136136
if(*obj == "STREET"sv)
137137
obj++;
138-
ASN1_OBJECT *obja = OBJ_txt2obj(*obj, 0);
138+
auto obja = make_unique_ptr<ASN1_OBJECT_free>(OBJ_txt2obj(*obj, 0));
139139
if(!obja)
140140
return -1;
141141

@@ -158,7 +158,7 @@ int X509Crypto::compareIssuerToString(string_view name) const
158158
for(int i = 0; i < X509_NAME_entry_count(issuer); ++i)
159159
{
160160
X509_NAME_ENTRY *entb = X509_NAME_get_entry(issuer, i);
161-
if(OBJ_cmp(obja, X509_NAME_ENTRY_get_object(entb)) != 0)
161+
if(OBJ_cmp(obja.get(), X509_NAME_ENTRY_get_object(entb)) != 0)
162162
continue;
163163

164164
char *val = nullptr;

0 commit comments

Comments
 (0)