Skip to content

Commit 3917135

Browse files
committed
Fix extra leak
1 parent a8d0e14 commit 3917135

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ext/openssl/openssl.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4256,7 +4256,13 @@ 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 || !q || !g) {
4260+
BN_free(p);
4261+
BN_free(q);
4262+
return 0;
4263+
}
4264+
4265+
if (!DH_set0_pqg(dh, p, q, g)) {
42604266
return 0;
42614267
}
42624268

0 commit comments

Comments
 (0)