summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-10 13:48:55 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-07-10 13:48:55 +0200
commit9ae4ef49cd2a44032c6c385151f35fc62a97e81d (patch)
tree1d83cee2e244433c602e450c4fb5b7b9db591e71 /src
parentc7dd2095269923915b872b31404579e31da36012 (diff)
downloadsystemd-9ae4ef49cd2a44032c6c385151f35fc62a97e81d.tar.gz
Remove string_free_erase
Diffstat (limited to 'src')
-rw-r--r--src/basic/string-util.c4
-rw-r--r--src/basic/string-util.h4
-rw-r--r--src/firstboot/firstboot.c3
-rw-r--r--src/reply-password/reply-password.c2
4 files changed, 3 insertions, 10 deletions
diff --git a/src/basic/string-util.c b/src/basic/string-util.c
index 779048904a..08a10e8787 100644
--- a/src/basic/string-util.c
+++ b/src/basic/string-util.c
@@ -1042,10 +1042,6 @@ char* string_erase(char *x) {
return x;
}
-char *string_free_erase(char *s) {
- return mfree(string_erase(s));
-}
-
bool string_is_safe(const char *p) {
const char *t;
diff --git a/src/basic/string-util.h b/src/basic/string-util.h
index 47b17c9d3e..5ad78be1d3 100644
--- a/src/basic/string-util.h
+++ b/src/basic/string-util.h
@@ -199,10 +199,6 @@ int free_and_strndup(char **p, const char *s, size_t l);
char *string_erase(char *x);
-char *string_free_erase(char *s);
-DEFINE_TRIVIAL_CLEANUP_FUNC(char *, string_free_erase);
-#define _cleanup_string_free_erase_ _cleanup_(string_free_erasep)
-
bool string_is_safe(const char *p) _pure_;
static inline size_t strlen_ptr(const char *s) {
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
index e6b40294bf..e0c834cfc3 100644
--- a/src/firstboot/firstboot.c
+++ b/src/firstboot/firstboot.c
@@ -30,6 +30,7 @@
#include "kbd-util.h"
#include "locale-util.h"
#include "main-func.h"
+#include "memory-util.h"
#include "mkdir.h"
#include "os-util.h"
#include "parse-util.h"
@@ -68,7 +69,7 @@ STATIC_DESTRUCTOR_REGISTER(arg_locale_messages, freep);
STATIC_DESTRUCTOR_REGISTER(arg_keymap, freep);
STATIC_DESTRUCTOR_REGISTER(arg_timezone, freep);
STATIC_DESTRUCTOR_REGISTER(arg_hostname, freep);
-STATIC_DESTRUCTOR_REGISTER(arg_root_password, string_free_erasep);
+STATIC_DESTRUCTOR_REGISTER(arg_root_password, erase_and_freep);
static bool press_any_key(void) {
char k = 0;
diff --git a/src/reply-password/reply-password.c b/src/reply-password/reply-password.c
index 455788a184..1a8a9a6d62 100644
--- a/src/reply-password/reply-password.c
+++ b/src/reply-password/reply-password.c
@@ -47,7 +47,7 @@ static int run(int argc, char *argv[]) {
return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Wrong number of arguments.");
if (streq(argv[1], "1")) {
- _cleanup_string_free_erase_ char *line = NULL;
+ _cleanup_(erase_and_freep) char *line = NULL;
r = read_line(stdin, LONG_LINE_MAX, &line);
if (r < 0)