mirror of
https://github.com/redis/redis.git
synced 2026-05-28 04:02:46 -04:00
Assert dictAdd success in pubsubRekeySubscriptionsForACLLoad
A failed insert would silently leak the pubsubUserSubs value and drop provenance tracking, since the old dict's destructors are disabled before release. Assert DICT_OK to catch duplicates early, matching the style used in the subscribe path.
This commit is contained in:
parent
3c680f96fc
commit
140d1b7099
1 changed files with 2 additions and 2 deletions
|
|
@ -981,11 +981,11 @@ void pubsubRekeySubscriptionsForACLLoad(client *c) {
|
|||
|
||||
if (pubsubUserIsNoAuth(old_user_ptr)) {
|
||||
/* Sentinel key is a stable static pointer — carry it as-is. */
|
||||
dictAdd(new_dict, old_user_ptr, subs);
|
||||
serverAssert(dictAdd(new_dict, old_user_ptr, subs) == DICT_OK);
|
||||
} else {
|
||||
user *new_user = ACLGetUserByName(old_user_ptr->name, sdslen(old_user_ptr->name));
|
||||
serverAssert(new_user != NULL);
|
||||
dictAdd(new_dict, new_user, subs);
|
||||
serverAssert(dictAdd(new_dict, new_user, subs) == DICT_OK);
|
||||
}
|
||||
}
|
||||
dictResetIterator(&di);
|
||||
|
|
|
|||
Loading…
Reference in a new issue