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
c9274498
Commit
c9274498
authored
Apr 09, 2019
by
yongman
Committed by
antirez
Apr 26, 2019
Browse files
Fix memleak in bitfieldCommand
parent
635d8d83
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/bitops.c
View file @
c9274498
...
@@ -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
;
}
}
}
addReplyMultiBulkLen
(
c
,
numops
);
addReplyMultiBulkLen
(
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