if (ldap_get_option(ld->link, LDAP_X_OPT_CONNECT_TIMEOUT, &timeout)) {
RETURN_FALSE;
}
- zval_dtor(retval);
+ zval_ptr_dtor(retval);
ZVAL_LONG(retval, (timeout / 1000));
} break;
+ #endif
+ #ifdef LDAP_OPT_TIMEOUT
+ case LDAP_OPT_TIMEOUT:
+ {
+ struct timeval *timeout = NULL;
+
+ if (ldap_get_option(ld->link, LDAP_OPT_TIMEOUT, (void *) &timeout)) {
+ if (timeout) {
+ ldap_memfree(timeout);
+ }
+ RETURN_FALSE;
+ }
+ if (!timeout) {
+ RETURN_FALSE;
+ }
+ zval_dtor(retval);
+ ZVAL_LONG(retval, timeout->tv_sec);
+ ldap_memfree(timeout);
+ } break;
#endif
/* options with string value */
case LDAP_OPT_ERROR_STRING: