diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2015-10-15 10:02:35 -0400 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-10-19 23:13:07 +0200 |
commit | ab84f5b95e10e8ffa115696ddf29c48440c5bae4 (patch) | |
tree | a156b9b64ef953463e97d3722e70f638a2efff0e /src/firstboot/firstboot.c | |
parent | 1602b008531ba6e0c704588cb2643daef26b71d9 (diff) |
strv: Add _cleanup_strv_free_erase_ and _cleanup_string_free_erase_
Diffstat (limited to 'src/firstboot/firstboot.c')
-rw-r--r-- | src/firstboot/firstboot.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c index da247fbef8..82ebb91788 100644 --- a/src/firstboot/firstboot.c +++ b/src/firstboot/firstboot.c @@ -455,7 +455,7 @@ static int prompt_root_password(void) { msg2 = strjoina(draw_special_char(DRAW_TRIANGULAR_BULLET), " Please enter new root password again: "); for (;;) { - _cleanup_free_ char *a = NULL, *b = NULL; + _cleanup_string_free_erase_ char *a = NULL, *b = NULL; r = ask_password_tty(msg1, NULL, 0, 0, NULL, &a); if (r < 0) @@ -467,19 +467,14 @@ static int prompt_root_password(void) { } r = ask_password_tty(msg2, NULL, 0, 0, NULL, &b); - if (r < 0) { - string_erase(a); + if (r < 0) return log_error_errno(r, "Failed to query root password: %m"); - } if (!streq(a, b)) { log_error("Entered passwords did not match, please try again."); - string_erase(a); - string_erase(b); continue; } - string_erase(b); arg_root_password = a; a = NULL; break; |