]> git.ipfire.org Git - thirdparty/shadow.git/commit
chage: Remove unneeded xstrdup calls
authorTobias Stoeckmann <tobias@stoeckmann.org>
Tue, 23 Dec 2025 11:32:02 +0000 (12:32 +0100)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Tue, 23 Dec 2025 21:45:19 +0000 (22:45 +0100)
commitcf90975d11e3de30faa929c4be225ce97acb58f4
treeec11f8533fe28ed5ca39d21465d69c2492454edb
parent16a388c644bb124bc5523839f64587669e5c171d
chage: Remove unneeded xstrdup calls

Duplicating name and hash is not needed here, because duplication
occurs in spw_update. You can detect the small memory leak with
tools like valgrind.

More importantly though, if xstrdup fails, it calls exit. The
update_age function is in the "criticial section" between
open_files and close_files, though. Correct error handling would
require fail_exit to release the held locks.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
src/chage.c