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