Commit 2f4dd7e0 authored by antirez's avatar antirez
Browse files

minor fix for the skiplist code, resulting in a false positive with valgrind,...

minor fix for the skiplist code, resulting in a false positive with valgrind, and in general into a useless small allocation
parent dcb518fd
...@@ -5412,8 +5412,10 @@ static zskiplistNode *zslCreateNode(int level, double score, robj *obj) { ...@@ -5412,8 +5412,10 @@ static zskiplistNode *zslCreateNode(int level, double score, robj *obj) {
zskiplistNode *zn = zmalloc(sizeof(*zn)); zskiplistNode *zn = zmalloc(sizeof(*zn));
zn->forward = zmalloc(sizeof(zskiplistNode*) * level); zn->forward = zmalloc(sizeof(zskiplistNode*) * level);
if (level > 0) if (level > 1)
zn->span = zmalloc(sizeof(unsigned int) * (level - 1)); zn->span = zmalloc(sizeof(unsigned int) * (level - 1));
else
zn->span = NULL;
zn->score = score; zn->score = score;
zn->obj = obj; zn->obj = obj;
return zn; return zn;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment