type_spec++;
if (num_varargs > 0) {
- int iv = 0;
- zval *p = (zend_vm_stack_top(TSRMLS_C) - 1 - (arg_count - i));
-
*n_varargs = num_varargs;
-
- /* allocate space for array and store args */
- *varargs = (zval*)safe_emalloc(num_varargs, sizeof(zval), 0);
- while (num_varargs-- > 0) {
- ZVAL_COPY_VALUE(&(*varargs)[iv], p);
- iv++;
- p++;
- }
-
+ *varargs = (zend_vm_stack_top(TSRMLS_C) - 1 - (arg_count - i));
/* adjust how many args we have left and restart loop */
- num_args = num_args + 1 - iv;
- i += iv;
+ num_args += 1 - num_varargs;
+ i += num_varargs;
continue;
} else {
*varargs = NULL;
result = zend_call_function(&fci, &fcc TSRMLS_CC);
- if (num_args) {
- efree(params);
- }
-
if (result == FAILURE) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Invocation of function %s() failed", fptr->common.function_name->val);
obj_ce = mptr->common.scope;
} else {
if (Z_TYPE(params[0]) != IS_OBJECT) {
- efree(params);
_DO_THROW("Non-object passed to Invoke()");
/* Returns from this function */
}
obj_ce = Z_OBJCE(params[0]);
if (!instanceof_function(obj_ce, mptr->common.scope TSRMLS_CC)) {
- if (params) {
- efree(params);
- }
_DO_THROW("Given object is not an instance of the class this method was declared in");
/* Returns from this function */
}
result = zend_call_function(&fci, &fcc TSRMLS_CC);
- if (params) {
- efree(params);
- }
-
if (result == FAILURE) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC,
"Invocation of method %s::%s() failed", mptr->common.scope->name->val, mptr->common.function_name->val);
}
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "*", ¶ms, &num_args) == FAILURE) {
- if (params) {
- efree(params);
- }
zval_dtor(return_value);
RETURN_FALSE;
}
ZVAL_COPY_VALUE(&fcc.object, return_value);
if (zend_call_function(&fci, &fcc TSRMLS_CC) == FAILURE) {
- if (params) {
- efree(params);
- }
if (!ZVAL_IS_UNDEF(&retval)) {
zval_ptr_dtor(&retval);
}
if (!ZVAL_IS_UNDEF(&retval)) {
zval_ptr_dtor(&retval);
}
- if (params) {
- efree(params);
- }
} else if (ZEND_NUM_ARGS()) {
zend_throw_exception_ex(reflection_exception_ptr, 0 TSRMLS_CC, "Class %s does not have a constructor, so you cannot pass any constructor arguments", ce->name->val);
}
/* at this point argc can only be 6 or 7 */
for (i = 0; i < argc; i++) {
if (!zend_is_callable(*args[i], 0, &name TSRMLS_CC)) {
- efree(args);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument %d is not a valid callback", i+1);
efree(name);
RETURN_FALSE;
PS(mod_user_names).names[i] = *args[i];
}
- efree(args);
RETURN_TRUE;
}
/* }}} */
RETVAL_ZVAL_FAST(min);
}
-
- if (args) {
- efree(args);
- }
}
/* }}} */
RETVAL_ZVAL_FAST(max);
}
-
- if (args) {
- efree(args);
- }
}
/* }}} */
for (i=0; i<ZEND_NUM_ARGS(); i++) {
php_compact_var(EG(active_symbol_table), return_value, &args[i] TSRMLS_CC);
}
-
- if (args) {
- efree(args);
- }
}
/* }}} */
if (zend_hash_next_index_insert(Z_ARRVAL_P(stack), &new_var) == NULL) {
if (Z_REFCOUNTED(new_var)) Z_DELREF(new_var);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot add element to the array as the next element is already occupied");
- efree(args);
RETURN_FALSE;
}
}
/* Clean up and return the number of values in the stack */
- efree(args);
RETVAL_LONG(zend_hash_num_elements(Z_ARRVAL_P(stack)));
}
/* }}} */
zend_hash_destroy(&old_hash);
/* Clean up and return the number of elements in the stack */
- efree(args);
RETVAL_LONG(zend_hash_num_elements(Z_ARRVAL_P(stack)));
}
/* }}} */
for (i = 0; i < argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1);
- efree(args);
RETURN_NULL();
} else {
int num = zend_hash_num_elements(Z_ARRVAL(args[i]));
zend_hash_merge(Z_ARRVAL_P(return_value), Z_ARRVAL(args[i]), zval_add_ref, 1);
}
}
-
- efree(args);
}
/* }}} */
efree(ptrs);
efree(lists);
- efree(args);
RETURN_FALSE;
}
lists[i] = list;
efree(ptrs);
efree(lists);
- efree(args);
}
/* }}} */
for (i = 0; i < argc; i++) {
if (Z_TYPE(args[i]) != IS_ARRAY) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d is not an array", i + 1);
- RETVAL_NULL();
- goto out;
+ RETURN_NULL();
}
}
}
}
}
-out:
- efree(args);
}
/* }}} */
efree(ptrs);
efree(lists);
- efree(args);
RETURN_FALSE;
}
lists[i] = list;
efree(ptrs);
efree(lists);
- efree(args);
}
/* }}} */
efree(ARRAYG(multisort_flags)[k]);
}
efree(arrays);
- efree(args);
RETURN_TRUE;
}
efree(ARRAYG(multisort_flags)[k]);
}
efree(arrays);
- efree(args);
RETURN_TRUE;
}
/* }}} */
for (i = 0; i < n_arrays; i++) {
if (Z_TYPE(arrays[i]) != IS_ARRAY) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument #%d should be an array", i + 2);
- efree(arrays);
efree(args);
efree(array_len);
efree(array_pos);
/* Short-circuit: if no callback and only one array, just return it. */
if (!ZEND_FCI_INITIALIZED(fci) && n_arrays == 1) {
RETVAL_ZVAL(args[0], 1, 0);
- efree(arrays);
efree(array_len);
efree(array_pos);
efree(args);
}
}
- efree(arrays);
efree(params);
efree(array_len);
efree(array_pos);
if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
COPY_PZVAL_TO_ZVAL(*return_value, &retval);
}
-
- if (fci.params) {
- efree(fci.params);
- }
}
/* }}} */
Z_TYPE_P(object) != IS_STRING
) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument is not an object or class name");
- if (params) {
- efree(params);
- }
RETURN_FALSE;
}
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call %s()", Z_STRVAL_P(callback));
}
- if (n_params) {
- efree(params);
- }
}
/* }}} */
if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
COPY_PZVAL_TO_ZVAL(*return_value, &retval);
}
-
- if (fci.params) {
- efree(fci.params);
- }
}
/* }}} */
* with a leak if we have an invalid filehandle. This needs changing
* if the code behind ZEND_VERIFY_RESOURCE changed. - cc */
if (!what) {
- if (args) {
- efree(args);
- }
RETURN_FALSE;
}
buf = php_stream_get_line((php_stream *) what, NULL, 0, &len);
if (buf == NULL) {
- if (args) {
- efree(args);
- }
RETURN_FALSE;
}
result = php_sscanf_internal(buf, format, argc, args, 0, return_value TSRMLS_CC);
- if (args) {
- efree(args);
- }
efree(buf);
if (SCAN_ERROR_WRONG_PARAM_COUNT == result) {
/* verify the number of args */
if ((use_array && argc != (2 + format_offset))
|| (!use_array && argc < (1 + format_offset))) {
- efree(args);
WRONG_PARAM_COUNT_WITH_RETVAL(NULL);
}
ZVAL_COPY_VALUE(&newargs[i], zv);
i++;
}
- efree(args);
zval_dtor(&array);
args = newargs;
format_offset = 0;
if (argnum <= 0) {
efree(result);
- efree(args);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Argument number must be greater than zero");
return NULL;
}
PRINTF_DEBUG(("sprintf: getting width\n"));
if ((width = php_sprintf_getnumber(format, &inpos)) < 0) {
efree(result);
- efree(args);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Width must be greater than zero and less than %d", INT_MAX);
return NULL;
}
if (isdigit((int)format[inpos])) {
if ((precision = php_sprintf_getnumber(format, &inpos)) < 0) {
efree(result);
- efree(args);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Precision must be greater than zero and less than %d", INT_MAX);
return NULL;
}
if (argnum >= argc) {
efree(result);
- efree(args);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too few arguments");
return NULL;
}
}
}
- efree(args);
-
/* possibly, we have to make sure we have room for the terminating null? */
result->val[outpos]=0;
result->len = outpos;
case 'h':
case 'H':
if (currentarg >= num_args) {
- efree(argv);
efree(formatcodes);
efree(formatargs);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: not enough arguments", code);
currentarg += arg;
if (currentarg > num_args) {
- efree(argv);
efree(formatcodes);
efree(formatargs);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: too few arguments", code);
break;
default:
- efree(argv);
efree(formatcodes);
efree(formatargs);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type %c: unknown format code", code);
}
}
- efree(argv);
efree(formatcodes);
efree(formatargs);
output[outputpos] = '\0';
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid locale category name %s, must be one of LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, or LC_TIME", category);
zval_dtor(&tmp);
- if (args) {
- efree(args);
- }
RETURN_FALSE;
}
zval_dtor(&tmp);
}
zval_dtor(&tmp);
- if (args) {
- efree(args);
- }
RETURN_STRING(retval);
}
zval_dtor(&tmp);
}
#endif
- if (args) {
- efree(args);
- }
RETURN_FALSE;
}
/* }}} */
result = php_sscanf_internal(str, format, num_args, args, 0, return_value TSRMLS_CC);
- if (args) {
- efree(args);
- }
-
if (SCAN_ERROR_WRONG_PARAM_COUNT == result) {
WRONG_PARAM_COUNT;
}
for (i = 0; i < argc; i++) {
php_var_dump(&args[i], 1 TSRMLS_CC);
}
- efree(args);
}
/* }}} */
for (i = 0; i < argc; i++) {
php_debug_zval_dump(&args[i], 1 TSRMLS_CC);
}
- efree(args);
}
/* }}} */