Flush the array of allowed subcommands for the specified user * and command ID. */
| 692 | /* Flush the array of allowed subcommands for the specified user |
| 693 | * and command ID. */ |
| 694 | void 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) |
no test coverage detected