@@ -2202,7 +2202,6 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, int ext)
2202
2202
LDAPControl * * lserverctrls = NULL ;
2203
2203
ldap_resultdata * result ;
2204
2204
LDAPMessage * ldap_res ;
2205
- int i , msgid ;
2206
2205
size_t dn_len ;
2207
2206
int is_full_add = 0 ; /* flag for full add operation so ldap_mod_add can be put back into oper, gerrit THomson */
2208
2207
@@ -2314,19 +2313,21 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, int ext)
2314
2313
}
2315
2314
}
2316
2315
2317
- /* check flag to see if do_mod was called to perform full add , gerrit thomson */
2316
+ /* check flag to see if do_mod was called to perform full add , gerrit thomson */
2317
+ int ldap_status_code = LDAP_SUCCESS ;
2318
+ int msgid ;
2318
2319
if (is_full_add == 1 ) {
2319
2320
if (ext ) {
2320
- i = ldap_add_ext (ld -> link , dn , ldap_mods , lserverctrls , NULL , & msgid );
2321
+ ldap_status_code = ldap_add_ext (ld -> link , dn , ldap_mods , lserverctrls , NULL , & msgid );
2321
2322
} else {
2322
- i = ldap_add_ext_s (ld -> link , dn , ldap_mods , lserverctrls , NULL );
2323
+ ldap_status_code = ldap_add_ext_s (ld -> link , dn , ldap_mods , lserverctrls , NULL );
2323
2324
}
2324
- if (i != LDAP_SUCCESS ) {
2325
- php_error_docref (NULL , E_WARNING , "Add: %s" , ldap_err2string (i ));
2325
+ if (ldap_status_code != LDAP_SUCCESS ) {
2326
+ php_error_docref (NULL , E_WARNING , "Add: %s" , ldap_err2string (ldap_status_code ));
2326
2327
RETVAL_FALSE ;
2327
2328
} else if (ext ) {
2328
- i = ldap_result (ld -> link , msgid , 1 /* LDAP_MSG_ALL */ , NULL , & ldap_res );
2329
- if (i == -1 ) {
2329
+ ldap_status_code = ldap_result (ld -> link , msgid , 1 /* LDAP_MSG_ALL */ , NULL , & ldap_res );
2330
+ if (ldap_status_code == -1 ) {
2330
2331
php_error_docref (NULL , E_WARNING , "Add operation failed" );
2331
2332
RETVAL_FALSE ;
2332
2333
goto cleanup ;
@@ -2339,16 +2340,16 @@ static void php_ldap_do_modify(INTERNAL_FUNCTION_PARAMETERS, int oper, int ext)
2339
2340
} else RETVAL_TRUE ;
2340
2341
} else {
2341
2342
if (ext ) {
2342
- i = ldap_modify_ext (ld -> link , dn , ldap_mods , lserverctrls , NULL , & msgid );
2343
+ ldap_status_code = ldap_modify_ext (ld -> link , dn , ldap_mods , lserverctrls , NULL , & msgid );
2343
2344
} else {
2344
- i = ldap_modify_ext_s (ld -> link , dn , ldap_mods , lserverctrls , NULL );
2345
+ ldap_status_code = ldap_modify_ext_s (ld -> link , dn , ldap_mods , lserverctrls , NULL );
2345
2346
}
2346
- if (i != LDAP_SUCCESS ) {
2347
- php_error_docref (NULL , E_WARNING , "Modify: %s" , ldap_err2string (i ));
2347
+ if (ldap_status_code != LDAP_SUCCESS ) {
2348
+ php_error_docref (NULL , E_WARNING , "Modify: %s" , ldap_err2string (ldap_status_code ));
2348
2349
RETVAL_FALSE ;
2349
2350
} else if (ext ) {
2350
- i = ldap_result (ld -> link , msgid , 1 /* LDAP_MSG_ALL */ , NULL , & ldap_res );
2351
- if (i == -1 ) {
2351
+ ldap_status_code = ldap_result (ld -> link , msgid , 1 /* LDAP_MSG_ALL */ , NULL , & ldap_res );
2352
+ if (ldap_status_code == -1 ) {
2352
2353
php_error_docref (NULL , E_WARNING , "Modify operation failed" );
2353
2354
RETVAL_FALSE ;
2354
2355
goto cleanup ;
0 commit comments