CID 1442836: Resource leaks

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/8318)
This commit is contained in:
Pauli 2019-02-24 21:26:20 +10:00
parent 9257959950
commit 909f2e5983

View File

@ -143,11 +143,12 @@ static void alg_cleanup(size_t idx, ALGORITHM *a)
OSSL_METHOD_STORE *ossl_method_store_new(void) OSSL_METHOD_STORE *ossl_method_store_new(void)
{ {
OSSL_METHOD_STORE *res = OPENSSL_zalloc(sizeof(*res)); OSSL_METHOD_STORE *res;
if (!RUN_ONCE(&method_store_init_flag, do_method_store_init)) if (!RUN_ONCE(&method_store_init_flag, do_method_store_init))
return 0; return 0;
res = OPENSSL_zalloc(sizeof(*res));
if (res != NULL) { if (res != NULL) {
if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL) { if ((res->algs = ossl_sa_ALGORITHM_new()) == NULL) {
OPENSSL_free(res); OPENSSL_free(res);