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
58e34e6c
Commit
58e34e6c
authored
Mar 23, 2012
by
antirez
Browse files
Fixed memory leak in hash loading.
parent
03116904
Changes
1
Show whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
58e34e6c
...
...
@@ -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