Addressing possible leaks in ssl.c and api.c

pull/4213/head
Lealem Amedie 2021-07-16 09:48:06 -06:00
parent b9c707511b
commit 73323e694f
2 changed files with 3 additions and 1 deletions

View File

@ -9713,6 +9713,7 @@ void* wolfSSL_X509V3_EXT_d2i(WOLFSSL_X509_EXTENSION* ext)
aiaEntry->obj, aiaEntry->objSz);
if (ret != WOLFSSL_SUCCESS) {
WOLFSSL_MSG("ASN1_STRING_set() failed");
wolfSSL_ASN1_STRING_free(ad->location->d.uniformResourceIdentifier);
wolfSSL_ASN1_OBJECT_free(ad->method);
XFREE(aia, NULL, DYNAMIC_TYPE_X509_EXT);
XFREE(ad->location, NULL, DYNAMIC_TYPE_OPENSSL);

View File

@ -1133,8 +1133,9 @@ static int test_cm_load_ca_file(const char* ca_cert_file)
}
#endif
free(cert_buf);
}
free(cert_buf);
return ret;
}
#endif /* !NO_FILESYSTEM && !NO_CERTS */