Skip to content

Commit f7b6e48

Browse files
committed
Don't allocate four times more space than needed. Duh.
* subversion/tests/libsvn_subr/adler32-test.c (make_random_data): We just worked out how many 32-bit random integers we'll generate, so maybe allocate space for only so many? git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1931369 13f79535-47bb-0310-9956-ffa450edef68
1 parent 30f6724 commit f7b6e48

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

subversion/tests/libsvn_subr/adler32-test.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static const char *make_random_data(apr_uint32_t *initial_seed,
4040
{
4141
const apr_off_t count = (len / sizeof(apr_uint32_t)
4242
+ (len % sizeof(apr_uint32_t) ? 1 : 0));
43-
apr_uint32_t *data = apr_palloc(pool, len * sizeof(*data));
43+
apr_uint32_t *data = apr_palloc(pool, count * sizeof(*data));
4444
apr_uint32_t seed = *initial_seed = (apr_uint32_t)apr_time_now();
4545
apr_off_t i;
4646

@@ -115,7 +115,6 @@ do_random_test(apr_uint32_t *seed,
115115
const apr_size_t array_size,
116116
apr_pool_t *pool)
117117
{
118-
119118
const char *data = make_random_data(seed, lengths[array_size - 1], pool);
120119
int i;
121120

0 commit comments

Comments
 (0)