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
01a83d0a
Commit
01a83d0a
authored
May 18, 2016
by
Salvatore Sanfilippo
Browse files
Merge pull request #3239 from dvirsky/fix_hashset_crash
fixed bad transfer of ownership in HashSet causing a potential crash
parents
bee963c4
cfaef8d5
Changes
1
Show whitespace changes
Inline
Side-by-side
src/module.c
View file @
01a83d0a
...
...
@@ -1795,10 +1795,13 @@ int RM_HashSet(RedisModuleKey *key, int flags, ...) {
if
(
flags
&
REDISMODULE_HASH_CFIELDS
)
low_flags
|=
HASH_SET_TAKE_FIELD
;
updated
+=
hashTypeSet
(
key
->
value
,
field
->
ptr
,
value
->
ptr
,
low_flags
);
field
->
ptr
=
NULL
;
/* Ownership is now of hashTypeSet() */
/* If CFIELDS is active, ownership is now of hashTypeSet() */
if
(
flags
&
REDISMODULE_HASH_CFIELDS
)
{
field
->
ptr
=
NULL
;
/* Cleanup */
if
(
flags
&
REDISMODULE_HASH_CFIELDS
)
decrRefCount
(
field
);
decrRefCount
(
field
);
}
}
va_end
(
ap
);
moduleDelKeyIfEmpty
(
key
);
...
...
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