From: Xinchen Hui Date: Thu, 10 Sep 2015 11:56:18 +0000 (+0800) Subject: Merge branch 'PHP-5.6' X-Git-Tag: php-7.1.0alpha1~1191 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb4c0c0703efb7ca06deee67be55957458f24f5e;p=php Merge branch 'PHP-5.6' --- bb4c0c0703efb7ca06deee67be55957458f24f5e diff --cc ext/ldap/ldap.c index c717e63982,ab663b156b..1514025db5 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@@ -2115,9 -2066,28 +2118,28 @@@ PHP_FUNCTION(ldap_get_option 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: