Skip to content

Commit 890c2f0

Browse files
committed
ext/ldap: fix leak on port overflow check.
1 parent c978111 commit 890c2f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/ldap/ldap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,6 @@ PHP_FUNCTION(ldap_connect)
984984
RETURN_FALSE;
985985
}
986986

987-
object_init_ex(return_value, ldap_link_ce);
988-
ld = Z_LDAP_LINK_P(return_value);
989987

990988
{
991989
int rc = LDAP_SUCCESS;
@@ -1015,6 +1013,8 @@ PHP_FUNCTION(ldap_connect)
10151013
LDAPG(tls_newctx) = false;
10161014
}
10171015
#endif
1016+
object_init_ex(return_value, ldap_link_ce);
1017+
ld = Z_LDAP_LINK_P(return_value);
10181018

10191019
#ifdef LDAP_API_FEATURE_X_OPENLDAP
10201020
/* ldap_init() is deprecated, use ldap_initialize() instead.

0 commit comments

Comments
 (0)