Skip to content

Commit 37e79ef

Browse files
committed
Fix extra leak
1 parent a8d0e14 commit 37e79ef

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ext/openssl/openssl.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4256,7 +4256,12 @@ static bool php_openssl_pkey_init_legacy_dh(DH *dh, zval *data, bool *is_private
42564256
OPENSSL_PKEY_SET_BN(data, p);
42574257
OPENSSL_PKEY_SET_BN(data, q);
42584258
OPENSSL_PKEY_SET_BN(data, g);
4259-
if (!p || !g || !DH_set0_pqg(dh, p, q, g)) {
4259+
if (!p) {
4260+
BN_free(p);
4261+
return 0;
4262+
}
4263+
4264+
if (!DH_set0_pqg(dh, p, q, g)) {
42604265
return 0;
42614266
}
42624267

0 commit comments

Comments
 (0)