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

Got back to calling alias_free() on alias_add() failure.

We now need to remove the name and members from the leak list
*before* calling alias_add() since alias_add() will consume them
for both success and failure.
This commit is contained in:
Todd C. Miller
2021-02-02 14:40:37 -07:00
parent 8f2254594f
commit bdb02b1eff
3 changed files with 18 additions and 18 deletions

View File

@@ -136,11 +136,11 @@ alias_add(struct sudoers_parse_tree *parse_tree, char *name, int type,
HLTQ_TO_TAILQ(&a->members, members, entries);
switch (rbinsert(parse_tree->aliases, a, NULL)) {
case 1:
free(a);
alias_free(a);
errno = EEXIST;
debug_return_bool(false);
case -1:
free(a);
alias_free(a);
debug_return_bool(false);
}
debug_return_bool(true);