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
201037f5
Commit
201037f5
authored
Mar 29, 2010
by
antirez
Browse files
Fixed a refcount stuff leading to PUBSUB crashes
parent
de450ee9
Changes
1
Show whitespace changes
Inline
Side-by-side
redis.c
View file @
201037f5
...
...
@@ -9301,6 +9301,8 @@ static int pubsubUnsubscribe(redisClient *c, robj *class, int notify) {
int retval = 0;
/* Remove the class from the client -> classes hash table */
incrRefCount(class); /* class may be just a pointer to the same object
we have in the hash tables. Protect it... */
if (dictDelete(c->pubsub_classes,class) == DICT_OK) {
retval = 1;
/* Remove the client from the class -> clients list hash table */
...
...
@@ -9318,6 +9320,7 @@ static int pubsubUnsubscribe(redisClient *c, robj *class, int notify) {
addReplyBulk(c,class);
addReplyLong(c,dictSize(c->pubsub_classes));
}
decrRefCount(class); /* it is finally safe to release it */
return retval;
}
...
...
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