Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
7f1bb22e
Commit
7f1bb22e
authored
Oct 28, 2016
by
deep
Committed by
GitHub
Oct 28, 2016
Browse files
fix a bug for quicklistDup() function
parent
f39e7d4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/quicklist.c
View file @
7f1bb22e
...
...
@@ -1192,12 +1192,12 @@ quicklist *quicklistDup(quicklist *orig) {
current = current->next) {
quicklistNode *node = quicklistCreateNode();
if
(
node
->
encoding
==
QUICKLIST_NODE_ENCODING_LZF
)
{
quicklistLZF
*
lzf
=
(
quicklistLZF
*
)
node
->
zl
;
if (
current
->encoding == QUICKLIST_NODE_ENCODING_LZF) {
quicklistLZF *lzf = (quicklistLZF *)
current
->zl;
size_t lzf_sz = sizeof(*lzf) + lzf->sz;
node->zl = zmalloc(lzf_sz);
memcpy(node->zl, current->zl, lzf_sz);
}
else
if
(
node
->
encoding
==
QUICKLIST_NODE_ENCODING_RAW
)
{
} else if (
current
->encoding == QUICKLIST_NODE_ENCODING_RAW) {
node->zl = zmalloc(current->sz);
memcpy(node->zl, current->zl, current->sz);
}
...
...
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