mirror of
https://github.com/shadow-maint/shadow.git
synced 2026-01-26 14:03:17 +00:00
src/useradd.c: set_defaults(): Fix order of clean-ups
Resources should be freed in the inverse order of the allocation. This refactor prepares for the following commits, which fix some leaks. Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
parent
4c16416ebc
commit
f8fc6371f6
@ -745,10 +745,9 @@ static int set_defaults (void)
|
||||
def_create_mail_spool, def_log_init));
|
||||
ret = 0;
|
||||
setdef_err:
|
||||
free(new_file);
|
||||
if (prefix[0]) {
|
||||
if (prefix[0])
|
||||
free(default_file);
|
||||
}
|
||||
free(new_file);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user