mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
minor fix for the skiplist code, resulting in a false positive with valgrind, and in general into a useless small allocation
This commit is contained in:
parent
dcb518fd16
commit
2f4dd7e0fd
4
redis.c
4
redis.c
@ -5412,8 +5412,10 @@ static zskiplistNode *zslCreateNode(int level, double score, robj *obj) {
|
||||
zskiplistNode *zn = zmalloc(sizeof(*zn));
|
||||
|
||||
zn->forward = zmalloc(sizeof(zskiplistNode*) * level);
|
||||
if (level > 0)
|
||||
if (level > 1)
|
||||
zn->span = zmalloc(sizeof(unsigned int) * (level - 1));
|
||||
else
|
||||
zn->span = NULL;
|
||||
zn->score = score;
|
||||
zn->obj = obj;
|
||||
return zn;
|
||||
|
Loading…
x
Reference in New Issue
Block a user