Skip to content

Commit 8188e64

Browse files
committed
ext/ldap: Refactor execution of batch command
1 parent 0c7d85d commit 8188e64

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ext/ldap/ldap.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2734,10 +2734,13 @@ PHP_FUNCTION(ldap_modify_batch)
27342734
}
27352735

27362736
/* perform (finally) */
2737-
if ((i = ldap_modify_ext_s(ld->link, dn, ldap_mods, lserverctrls, NULL)) != LDAP_SUCCESS) {
2738-
php_error_docref(NULL, E_WARNING, "Batch Modify: %s", ldap_err2string(i));
2737+
int ldap_status = ldap_modify_ext_s(ld->link, dn, ldap_mods, lserverctrls, NULL);
2738+
if (ldap_status != LDAP_SUCCESS) {
2739+
php_error_docref(NULL, E_WARNING, "Batch Modify: %s", ldap_err2string(ldap_status));
27392740
RETVAL_FALSE;
2740-
} else RETVAL_TRUE;
2741+
} else {
2742+
RETVAL_TRUE;
2743+
}
27412744

27422745
/* clean up */
27432746
cleanup: {

0 commit comments

Comments
 (0)