Skip to content

Commit 665e79c

Browse files
committed
ldap_connect fails if ldap_set_option fails
1 parent 2966b09 commit 665e79c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/ldap/ldap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,9 @@ PHP_FUNCTION(ldap_connect)
993993

994994
/* ensure all pending TLS options are applied in a new context */
995995
if (ldap_set_option(NULL, LDAP_OPT_X_TLS_NEWCTX, &val) != LDAP_OPT_SUCCESS) {
996+
zval_ptr_dtor(return_value);
996997
php_error_docref(NULL, E_WARNING, "Could not create new security context");
998+
RETURN_FALSE;
997999
}
9981000
}
9991001
#endif

0 commit comments

Comments
 (0)