2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 14:25:15 +00:00

Refactor freeing of a member_list into free_members().

This commit is contained in:
Todd C. Miller
2016-11-01 14:15:07 -06:00
parent 9de491dc27
commit 0aa216ed55
4 changed files with 46 additions and 38 deletions

View File

@@ -170,21 +170,10 @@ void
alias_free(void *v)
{
struct alias *a = (struct alias *)v;
struct member *m;
struct sudo_command *c;
void *next;
debug_decl(alias_free, SUDOERS_DEBUG_ALIAS)
free(a->name);
TAILQ_FOREACH_SAFE(m, &a->members, entries, next) {
if (m->type == COMMAND) {
c = (struct sudo_command *) m->name;
free(c->cmnd);
free(c->args);
}
free(m->name);
free(m);
}
free_members(&a->members);
free(a);
debug_return;