Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
f31d9b12
Commit
f31d9b12
authored
Nov 08, 2017
by
Itamar Haber
Committed by
antirez
Nov 08, 2017
Browse files
Fixes an off-by-one in argument handling of `MEMORY USAGE`
Fixes #4430
parent
897d8571
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/object.c
View file @
f31d9b12
...
@@ -1074,7 +1074,7 @@ void memoryCommand(client *c) {
...
@@ -1074,7 +1074,7 @@ void memoryCommand(client *c) {
if
((
o
=
objectCommandLookupOrReply
(
c
,
c
->
argv
[
2
],
shared
.
nullbulk
))
if
((
o
=
objectCommandLookupOrReply
(
c
,
c
->
argv
[
2
],
shared
.
nullbulk
))
==
NULL
)
return
;
==
NULL
)
return
;
size_t
usage
=
objectComputeSize
(
o
,
samples
);
size_t
usage
=
objectComputeSize
(
o
,
samples
);
usage
+=
sdsAllocSize
(
c
->
argv
[
1
]
->
ptr
);
usage
+=
sdsAllocSize
(
c
->
argv
[
2
]
->
ptr
);
usage
+=
sizeof
(
dictEntry
);
usage
+=
sizeof
(
dictEntry
);
addReplyLongLong
(
c
,
usage
);
addReplyLongLong
(
c
,
usage
);
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"stats"
)
&&
c
->
argc
==
2
)
{
}
else
if
(
!
strcasecmp
(
c
->
argv
[
1
]
->
ptr
,
"stats"
)
&&
c
->
argc
==
2
)
{
...
...
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