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
5ba908fa
Unverified
Commit
5ba908fa
authored
Apr 26, 2019
by
Salvatore Sanfilippo
Committed by
GitHub
Apr 26, 2019
Browse files
Merge pull request #6002 from yongman/fix-memleak-in-bitfield
Fix memleak in bitfieldCommand
parents
5c5197fe
d490752d
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bitops.c
View file @
5ba908fa
...
@@ -994,12 +994,18 @@ void bitfieldCommand(client *c) {
...
@@ -994,12 +994,18 @@ void bitfieldCommand(client *c) {
/* Lookup for read is ok if key doesn't exit, but errors
/* Lookup for read is ok if key doesn't exit, but errors
* if it's not a string. */
* if it's not a string. */
o
=
lookupKeyRead
(
c
->
db
,
c
->
argv
[
1
]);
o
=
lookupKeyRead
(
c
->
db
,
c
->
argv
[
1
]);
if
(
o
!=
NULL
&&
checkType
(
c
,
o
,
OBJ_STRING
))
return
;
if
(
o
!=
NULL
&&
checkType
(
c
,
o
,
OBJ_STRING
))
{
zfree
(
ops
);
return
;
}
}
else
{
}
else
{
/* Lookup by making room up to the farest bit reached by
/* Lookup by making room up to the farest bit reached by
* this operation. */
* this operation. */
if
((
o
=
lookupStringForBitCommand
(
c
,
if
((
o
=
lookupStringForBitCommand
(
c
,
highest_write_offset
))
==
NULL
)
return
;
highest_write_offset
))
==
NULL
)
{
zfree
(
ops
);
return
;
}
}
}
addReplyArrayLen
(
c
,
numops
);
addReplyArrayLen
(
c
,
numops
);
...
...
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