Permalink
Browse files

Fixed possible memory leak.

  • Loading branch information...
vincent-richard committed Sep 5, 2018
1 parent b55bdc9 commit 3bd864efc21ca6aa8f67521b4ef6f6410d66fba2
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/vmime/net/tls/gnutls/TLSSocket_GnuTLS.cpp
@@ -468,6 +468,11 @@ shared_ptr <security::cert::certificateChain> TLSSocket_GnuTLS::getPeerCertifica
int res = gnutls_x509_crt_import(x509Certs[i], rawData + i, GNUTLS_X509_FMT_DER);
if (res < 0) {
for (unsigned int j = 0 ; j <= i ; ++j) {
gnutls_x509_crt_deinit(x509Certs[j]);
}
// XXX more fine-grained error reporting?
delete [] x509Certs;
return null;

0 comments on commit 3bd864e

Please sign in to comment.