From ab84f5b95e10e8ffa115696ddf29c48440c5bae4 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Thu, 15 Oct 2015 10:02:35 -0400 Subject: strv: Add _cleanup_strv_free_erase_ and _cleanup_string_free_erase_ --- src/tty-ask-password-agent/tty-ask-password-agent.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/tty-ask-password-agent') diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index 7a5ac9fa9c..8423364046 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -307,7 +307,7 @@ static int parse_password(const char *filename, char **wall) { } if (arg_plymouth) { - _cleanup_strv_free_ char **passwords = NULL; + _cleanup_strv_free_erase_ char **passwords = NULL; r = ask_password_plymouth(message, not_after, accept_cached ? ASK_PASSWORD_ACCEPT_CACHED : 0, filename, &passwords); if (r >= 0) { @@ -330,10 +330,8 @@ static int parse_password(const char *filename, char **wall) { } } - strv_erase(passwords); - } else { - _cleanup_free_ char *password = NULL; + _cleanup_string_free_erase_ char *password = NULL; int tty_fd = -1; if (arg_console) { @@ -363,8 +361,6 @@ static int parse_password(const char *filename, char **wall) { strcpy(packet + 1, password); } } - - string_erase(password); } if (IN_SET(r, -ETIME, -ENOENT)) { -- cgit v1.2.3-54-g00ecf