From: Stig Venaas Date: Wed, 18 Oct 2000 07:47:51 +0000 (+0000) Subject: Added destruction of return value parameter, and using ZVAL_LONG and X-Git-Tag: php-4.0.4RC3~637 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2da9a94d38164a1f1029a3d657d5c703c8518468;p=php Added destruction of return value parameter, and using ZVAL_LONG and ZVAL_STRING to set return value in ldap_get_option. --- diff --git a/ext/ldap/ldap.c b/ext/ldap/ldap.c index b07525d321..6bf16de8ca 100644 --- a/ext/ldap/ldap.c +++ b/ext/ldap/ldap.c @@ -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