Skip to content

Commit

Permalink
FIX(server): Fix memory leak in Server::isKeyForCert
Browse files Browse the repository at this point in the history
BIO_set_close with BIO_NOCLOSE argument leads to memory leaks here

Closes #6603
  • Loading branch information
botanegg committed Oct 11, 2024
1 parent c02eab3 commit 138f3a4
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/murmur/Cert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,10 @@ bool Server::isKeyForCert(const QSslKey &key, const QSslCertificate &cert) {
BIO *mem = nullptr;

mem = BIO_new_mem_buf(qbaKey.data(), static_cast< int >(qbaKey.size()));
Q_UNUSED(BIO_set_close(mem, BIO_NOCLOSE));
pkey = d2i_PrivateKey_bio(mem, nullptr);
BIO_free(mem);

mem = BIO_new_mem_buf(qbaCert.data(), static_cast< int >(qbaCert.size()));
Q_UNUSED(BIO_set_close(mem, BIO_NOCLOSE));
x509 = d2i_X509_bio(mem, nullptr);
BIO_free(mem);
mem = nullptr;
Expand Down

0 comments on commit 138f3a4

Please sign in to comment.