summaryrefslogtreecommitdiff
path: root/cache.c
diff options
context:
space:
mode:
authorTrond Norbye <trond.norbye@gmail.com>2010-11-10 06:11:24 -0800
committerTrond Norbye <trond.norbye@gmail.com>2010-11-10 06:22:01 -0800
commit16a809e2a06200a624c8742554b8943de87cc356 (patch)
tree4209f2706a7a8648d71a9122120d061cd6521dae /cache.c
parentdf15887584f0025e7b188e408dd3c9f638d68518 (diff)
downloadmemcached-16a809e2a06200a624c8742554b8943de87cc356.tar.gz
Issue 161 incorrect allocation in cache_create
Diffstat (limited to 'cache.c')
-rw-r--r--cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cache.c b/cache.c
index 30355c5..e095962 100644
--- a/cache.c
+++ b/cache.c
@@ -21,7 +21,7 @@ cache_t* cache_create(const char *name, size_t bufsize, size_t align,
cache_destructor_t* destructor) {
cache_t* ret = calloc(1, sizeof(cache_t));
char* nm = strdup(name);
- void** ptr = calloc(initial_pool_size, bufsize);
+ void** ptr = calloc(initial_pool_size, sizeof(void*));
if (ret == NULL || nm == NULL || ptr == NULL ||
pthread_mutex_init(&ret->mutex, NULL) == -1) {
free(ret);