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
9b962d10
Commit
9b962d10
authored
Mar 23, 2012
by
antirez
Browse files
Fixed memory leak in hash loading.
parent
b64281cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
9b962d10
...
...
@@ -859,14 +859,17 @@ robj *rdbLoadObject(int rdbtype, rio *rdb) {
/* Add pair to ziplist */
o
->
ptr
=
ziplistPush
(
o
->
ptr
,
field
->
ptr
,
sdslen
(
field
->
ptr
),
ZIPLIST_TAIL
);
o
->
ptr
=
ziplistPush
(
o
->
ptr
,
value
->
ptr
,
sdslen
(
value
->
ptr
),
ZIPLIST_TAIL
);
/* Convert to hash table if size threshold is exceeded */
if
(
sdslen
(
field
->
ptr
)
>
server
.
hash_max_ziplist_value
||
sdslen
(
value
->
ptr
)
>
server
.
hash_max_ziplist_value
)
{
decrRefCount
(
field
);
decrRefCount
(
value
);
hashTypeConvert
(
o
,
REDIS_ENCODING_HT
);
break
;
}
decrRefCount
(
field
);
decrRefCount
(
value
);
}
/* Load remaining fields and values into the hash table */
...
...
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