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
b3e70733
Commit
b3e70733
authored
Nov 02, 2016
by
Salvatore Sanfilippo
Committed by
GitHub
Nov 02, 2016
Browse files
Merge pull request #3575 from deep011/unstable
fix a bug for quicklistDup() function
parents
c17fc392
7f1bb22e
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/quicklist.c
View file @
b3e70733
...
@@ -1192,12 +1192,12 @@ quicklist *quicklistDup(quicklist *orig) {
...
@@ -1192,12 +1192,12 @@ quicklist *quicklistDup(quicklist *orig) {
current
=
current
->
next
)
{
current
=
current
->
next
)
{
quicklistNode
*
node
=
quicklistCreateNode
();
quicklistNode
*
node
=
quicklistCreateNode
();
if
(
node
->
encoding
==
QUICKLIST_NODE_ENCODING_LZF
)
{
if
(
current
->
encoding
==
QUICKLIST_NODE_ENCODING_LZF
)
{
quicklistLZF
*
lzf
=
(
quicklistLZF
*
)
node
->
zl
;
quicklistLZF
*
lzf
=
(
quicklistLZF
*
)
current
->
zl
;
size_t
lzf_sz
=
sizeof
(
*
lzf
)
+
lzf
->
sz
;
size_t
lzf_sz
=
sizeof
(
*
lzf
)
+
lzf
->
sz
;
node
->
zl
=
zmalloc
(
lzf_sz
);
node
->
zl
=
zmalloc
(
lzf_sz
);
memcpy
(
node
->
zl
,
current
->
zl
,
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
);
node
->
zl
=
zmalloc
(
current
->
sz
);
memcpy
(
node
->
zl
,
current
->
zl
,
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