MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / ACLResetSubcommandsForCommand

Function ACLResetSubcommandsForCommand

src/acl.cpp:694–701  ·  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

692/* Flush the array of allowed subcommands for the specified user
693 * and command ID. */
694void ACLResetSubcommandsForCommand(user *u, unsigned long id) {
695 if (u->allowed_subcommands && u->allowed_subcommands[id]) {
696 for (int i = 0; u->allowed_subcommands[id][i]; i++)
697 sdsfree(u->allowed_subcommands[id][i]);
698 zfree(u->allowed_subcommands[id]);
699 u->allowed_subcommands[id] = NULL;
700 }
701}
702
703/* Flush the entire table of subcommands. This is useful on +@all, -@all
704 * 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.85

Tested by

no test coverage detected