Merge pull request #4213 from lealem47/leakFixes

Addressing possible leaks in ssl.c and api.c
This commit is contained in:
JacobBarthelmeh
2021-07-26 23:32:19 +07:00
committed by GitHub
2 changed files with 3 additions and 1 deletions

View File

@@ -9718,6 +9718,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 */