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
d490752d
Commit
d490752d
authored
Apr 09, 2019
by
yongman
Browse files
Fix memleak in bitfieldCommand
parent
c24e3204
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bitops.c
View file @
d490752d
...
...
@@ -994,12 +994,18 @@ void bitfieldCommand(client *c) {
/* Lookup for read is ok if key doesn't exit, but errors
* if it's not a string. */
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
{
/* Lookup by making room up to the farest bit reached by
* this operation. */
if
((
o
=
lookupStringForBitCommand
(
c
,
highest_write_offset
))
==
NULL
)
return
;
highest_write_offset
))
==
NULL
)
{
zfree
(
ops
);
return
;
}
}
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