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
b6f07345
Commit
b6f07345
authored
Apr 16, 2010
by
Pieter Noordhuis
Browse files
check object type in lookupKeyByPattern
parent
705dad38
Changes
1
Hide whitespace changes
Inline
Side-by-side
redis.c
View file @
b6f07345
...
...
@@ -6533,6 +6533,10 @@ static robj *lookupKeyByPattern(redisDb *db, robj *pattern, robj *subst) {
initStaticStringObject(fieldobj,((char*)&fieldname)+(sizeof(long)*2));
o = hashGet(o, &fieldobj);
} else {
if (o->type != REDIS_STRING) {
return NULL;
}
/* Every object that this function returns needs to have its refcount
* increased. sortCommand decreases it again. */
incrRefCount(o);
...
...
@@ -6707,10 +6711,6 @@ static void sortCommand(redisClient *c) {
/* lookup value to sort by */
byval = lookupKeyByPattern(c->db,sortby,vector[j].obj);
if (!byval) continue;
if
(
byval
->
type
!=
REDIS_STRING
)
{
decrRefCount
(
byval
);
continue
;
}
} else {
/* use object itself to sort by */
byval = vector[j].obj;
...
...
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