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:
Stig Venaas 2000-10-18 07:47:51 +00:00
parent d47e48329b
commit 2da9a94d38

View File

@ -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