Stefan Fuhrmann wrote on Mon, Apr 05, 2021 at 21:17:23 +0200:
> +static svn_error_t *output_processed(
> + svn_task__t **task,
> + svn_cancel_func_t cancel_func,
> + void *cancel_baton,
> + apr_pool_t *result_pool,
> + apr_pool_t *scratch_pool)
> +{
> + svn_task__t *current = *task;
> + root_t *root = current->root;
> + apr_pool_t *iterpool = svn_pool_create(scratch_pool);
> + output_t *output;
> + callbacks_t *callbacks;
> +
> + while (current && is_processed(current))
> + {
> + svn_pool_clear(iterpool);
> + if (current->first_sub)
> + {
> + current = current->first_sub;
> + output = current->output;
> + callbacks = current->parent->callbacks;
> + if (output && output->prior_parent_output)
> + SVN_ERR(callbacks->output_func(
> + current->parent, output->prior_parent_output,
> + callbacks->output_baton,
> + cancel_func, cancel_baton,
> + result_pool, iterpool));
FWIW: The pre-order of outputs surprised me. When I read that in the
docstring in r1888446 I thought it was a typo for "post-order", but it's
not.
> + }
> + else
> + {
> + output_t *output = current->output;
> + if (output)
> + {
> + svn_error_t *err = output->error;
> + output->error = SVN_NO_ERROR;
> + SVN_ERR(err);
> +
> + callbacks = current->callbacks;
> + if (output->output)
> + SVN_ERR(callbacks->output_func(
> + current, output->output,
> + callbacks->output_baton,
> + cancel_func, cancel_baton,
> + result_pool, iterpool));
> + }
> +
> + /* The output function may have added additional sub-tasks. */
> + if (!current->first_sub)
> + {
> + svn_task__t *to_delete = current;
> + current = to_delete->parent;
> + remove_task(to_delete);
Error leak. Cf. tools/dev/warn-ignored-err.sh.
> + if (output)
> + svn_pool_destroy(output->pool);
> + }
> + }
> + }
> +
> + svn_pool_destroy(iterpool);
> + *task = current;
> +
> + return SVN_NO_ERROR;
> +}