Fixed possible memory leak.

This commit is contained in:
Vincent Richard 2018-09-06 00:05:13 +02:00
parent b55bdc9c0b
commit 3bd864efc2

View File

@ -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;