summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2015-01-14 07:27:41 -0500
committerAllan McRae <allan@archlinux.org>2015-01-21 14:27:04 +1000
commitc6263da168f7d612ea221e868fe42ad2ed706fa9 (patch)
tree0291ad89e23bec4557252a04757113b5db29b4e3 /lib
parent21281e9b69fa061bb64b6fb4e25f04bd0e530554 (diff)
downloadpacman-c6263da168f7d612ea221e868fe42ad2ed706fa9.tar.xz
fix geometric growth in _alpm_greedy_grow
It was allocating the required size rather than the calculated new size, resulting in pathological incremental reallocations. Signed-off-by: Daniel Micay <danielmicay@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 43d0d7be..1e367369 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -1326,7 +1326,7 @@ void *_alpm_greedy_grow(void **data, size_t *current, const size_t required)
return NULL;
}
- return _alpm_realloc(data, current, required);
+ return _alpm_realloc(data, current, newsize);
}
void _alpm_alloc_fail(size_t size)