Skip to content

Commit ac6543c

Browse files
authored
fix asan (#275)
Signed-off-by: turuslan <[email protected]>
1 parent d85fdc6 commit ac6543c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/security/tls/tls_details.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ namespace libp2p::security::tls_details {
208208
}
209209

210210
ASN1_INTEGER *rand_int = ASN1_INTEGER_new();
211+
CLEANUP_PTR(rand_int, ASN1_INTEGER_free);
211212
BN_to_ASN1_INTEGER(bn, rand_int);
212213

213214
if (X509_set_serialNumber(cert, rand_int) == 0) {
214-
ASN1_INTEGER_free(rand_int);
215215
throw std::runtime_error("cannot add SN to certificate");
216216
}
217217
}

0 commit comments

Comments
 (0)