mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Added destruction of return value parameter, and using ZVAL_LONG and
ZVAL_STRING to set return value in ldap_get_option.
This commit is contained in:
parent
d47e48329b
commit
2da9a94d38
@ -1525,8 +1525,8 @@ PHP_FUNCTION(ldap_get_option) {
|
||||
if (ldap_get_option(ldap, opt, &val)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
(*retval)->type = IS_LONG;
|
||||
(*retval)->value.lval = val;
|
||||
zval_dtor(*retval);
|
||||
ZVAL_LONG(*retval, val);
|
||||
} break;
|
||||
/* options with string value */
|
||||
case LDAP_OPT_HOST_NAME:
|
||||
@ -1538,10 +1538,8 @@ PHP_FUNCTION(ldap_get_option) {
|
||||
if (ldap_get_option(ldap, opt, &val)) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
(*retval)->type = IS_STRING;
|
||||
len = strlen(val);
|
||||
(*retval)->value.str.len = len;
|
||||
(*retval)->value.str.val = estrndup(val, len);
|
||||
zval_dtor(*retval);
|
||||
ZVAL_STRING(*retval, val, 1);
|
||||
ldap_memfree(val);
|
||||
} break;
|
||||
/* options not implemented
|
||||
|
Loading…
Reference in New Issue
Block a user