Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
41868796
Commit
41868796
authored
Jan 11, 2017
by
antirez
Browse files
Defrag: do not crash on empty quicklist.
parent
e91f0ea1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/defrag.c
View file @
41868796
...
...
@@ -308,7 +308,7 @@ int defargKey(redisDb *db, dictEntry *de) {
quicklistNode
*
node
=
ql
->
head
,
*
newnode
;
if
((
newql
=
activeDefragAlloc
(
ql
)))
defragged
++
,
ob
->
ptr
=
ql
=
newql
;
do
{
while
(
node
)
{
if
((
newnode
=
activeDefragAlloc
(
node
)))
{
if
(
newnode
->
prev
)
newnode
->
prev
->
next
=
newnode
;
...
...
@@ -323,7 +323,8 @@ int defargKey(redisDb *db, dictEntry *de) {
}
if
((
newzl
=
activeDefragAlloc
(
node
->
zl
)))
defragged
++
,
node
->
zl
=
newzl
;
}
while
((
node
=
node
->
next
));
node
=
node
->
next
;
}
}
else
if
(
ob
->
encoding
==
OBJ_ENCODING_ZIPLIST
)
{
if
((
newzl
=
activeDefragAlloc
(
ob
->
ptr
)))
defragged
++
,
ob
->
ptr
=
newzl
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment