summaryrefslogtreecommitdiff
path: root/src/basic/util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-10-15 10:02:35 -0400
committerLennart Poettering <lennart@poettering.net>2015-10-19 23:13:07 +0200
commitab84f5b95e10e8ffa115696ddf29c48440c5bae4 (patch)
treea156b9b64ef953463e97d3722e70f638a2efff0e /src/basic/util.c
parent1602b008531ba6e0c704588cb2643daef26b71d9 (diff)
strv: Add _cleanup_strv_free_erase_ and _cleanup_string_free_erase_
Diffstat (limited to 'src/basic/util.c')
-rw-r--r--src/basic/util.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/basic/util.c b/src/basic/util.c
index f24db9796e..a14ed2e4cc 100644
--- a/src/basic/util.c
+++ b/src/basic/util.c
@@ -6817,9 +6817,10 @@ void string_erase(char *x) {
memory_erase(x, strlen(x));
}
-void strv_erase(char **l) {
- char **i;
+char *string_free_erase(char *s) {
+ if (!s)
+ return NULL;
- STRV_FOREACH(i, l)
- string_erase(*i);
+ string_erase(s);
+ return mfree(s);
}