summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2019-05-10 12:25:18 +0200
committerGitHub <noreply@github.com>2019-05-10 12:25:18 +0200
commit433f7638141e1490a7d1165b99dd35d81ca38bf8 (patch)
tree007c84aea0470749a6894f46eedb9cf48fd32ae2
parent402b0d0bd12add7516365f5375717f400d84d1d3 (diff)
parent842dd85b264f7d77a12273f8b2e7700ce99dd610 (diff)
downloadredis-433f7638141e1490a7d1165b99dd35d81ca38bf8.tar.gz
Merge pull request #6083 from tangquanawj/fix-inappropriate-add-operation-code
fix-inappropriate-add-operation-code
-rw-r--r--src/ziplist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ziplist.c b/src/ziplist.c
index 1579d1109..ef40d6aa2 100644
--- a/src/ziplist.c
+++ b/src/ziplist.c
@@ -576,7 +576,7 @@ void zipEntry(unsigned char *p, zlentry *e) {
/* Create a new empty ziplist. */
unsigned char *ziplistNew(void) {
- unsigned int bytes = ZIPLIST_HEADER_SIZE+1;
+ unsigned int bytes = ZIPLIST_HEADER_SIZE+ZIPLIST_END_SIZE;
unsigned char *zl = zmalloc(bytes);
ZIPLIST_BYTES(zl) = intrev32ifbe(bytes);
ZIPLIST_TAIL_OFFSET(zl) = intrev32ifbe(ZIPLIST_HEADER_SIZE);