Follow-up to r1888589: Fix bad size in memory allocations
* subversion/tests/libsvn_subr/task-test.c
(counter_func): Fix wrong allocation size in 5 similar calls to
apr_palloc(). Was allocating size of pointer, not size of pointed-to
object.
Found by: danielsh
@@ -124,13 +124,13 @@ counter_func(void **result,
if (value > 1)
{
- partial_result = apr_palloc(result_pool, sizeof(partial_result));
+ partial_result = apr_palloc(result_pool, sizeof(*partial_result));
*partial_result = 1;
value -= *partial_result;
sub_task_pool = svn_task__create_process_pool(task);
- partial_baton = apr_palloc(sub_task_pool, sizeof(partial_baton));
+ partial_baton = apr_palloc(sub_task_pool, sizeof(*partial_baton));
*partial_baton = MAX(1, value / 2);
value -= *partial_baton;
@@ -143,13 +143,13 @@ counter_func(void **result,
if (value > 1)
{
- partial_result = apr_palloc(result_pool, sizeof(partial_result));
+ partial_result = apr_palloc(result_pool, sizeof(*partial_result));
*partial_result = 1;
value -= *partial_result;
sub_task_pool = svn_task__create_process_pool(task);
- partial_baton = apr_palloc(sub_task_pool, sizeof(partial_baton));
+ partial_baton = apr_palloc(sub_task_pool, sizeof(*partial_baton));
*partial_baton = value - 1;
value -= *partial_baton;
@@ -157,7 +157,7 @@ counter_func(void **result,
partial_result, partial_baton));
}
- partial_result = apr_palloc(result_pool, sizeof(partial_result));
+ partial_result = apr_palloc(result_pool, sizeof(*partial_result));
*partial_result = value;
*result = partial_result;
