diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 12383ac8c2c80..6902c625d039e 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -4256,7 +4256,12 @@ static bool php_openssl_pkey_init_legacy_dh(DH *dh, zval *data, bool *is_private OPENSSL_PKEY_SET_BN(data, p); OPENSSL_PKEY_SET_BN(data, q); OPENSSL_PKEY_SET_BN(data, g); - if (!p || !g || !DH_set0_pqg(dh, p, q, g)) { + if (!p || !q) { + BN_free(p); + return 0; + } + + if (!DH_set0_pqg(dh, p, q, g)) { return 0; } @@ -4269,6 +4274,10 @@ static bool php_openssl_pkey_init_legacy_dh(DH *dh, zval *data, bool *is_private if (priv_key) { pub_key = php_openssl_dh_pub_from_priv(priv_key, g, p); if (pub_key == NULL) { + BN_free(p); + BN_free(q); + BN_free(g); + BN_free(priv_key); return 0; } return DH_set0_key(dh, pub_key, priv_key); diff --git a/main/php_version.h b/main/php_version.h index a508f5375c464..a6084939e04eb 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.ac to change version number */ #define PHP_MAJOR_VERSION 8 #define PHP_MINOR_VERSION 4 -#define PHP_RELEASE_VERSION 18 +#define PHP_RELEASE_VERSION 19 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "8.4.18-dev" -#define PHP_VERSION_ID 80418 +#define PHP_VERSION "8.4.19-dev" +#define PHP_VERSION_ID 80419