MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ACLResetSubcommandsForCommand

Function ACLResetSubcommandsForCommand

app/redis-6.2.6/src/acl.c:685–692  ·  view source on GitHub ↗

Flush the array of allowed subcommands for the specified user * and command ID. */

Source from the content-addressed store, hash-verified

683/* Flush the array of allowed subcommands for the specified user
684 * and command ID. */
685void ACLResetSubcommandsForCommand(user *u, unsigned long id) {
686 if (u->allowed_subcommands && u->allowed_subcommands[id]) {
687 for (int i = 0; u->allowed_subcommands[id][i]; i++)
688 sdsfree(u->allowed_subcommands[id][i]);
689 zfree(u->allowed_subcommands[id]);
690 u->allowed_subcommands[id] = NULL;
691 }
692}
693
694/* Flush the entire table of subcommands. This is useful on +@all, -@all
695 * or similar to return back to the minimal memory usage (and checks to do)

Callers 2

ACLSetUserFunction · 0.85

Calls 2

sdsfreeFunction · 0.85
zfreeFunction · 0.70

Tested by

no test coverage detected